如何在 Xcode 中创建发布版本?
为什么当我构建应用程序时,Xcode 会创建调试构建?我想创建一个发布版本。我该怎么做?
Why is it that when I build an application, Xcode creates a debug build? I want to create a release build. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
产品 / 方案 / 编辑方案..
然后从出现的菜单中,选择“构建配置”下的发布。
Product / Scheme / Edit Scheme..
And from the menu that comes up, select Release under "Build Configuration".
Xcode 11
我发现这个问题是因为我已经完成了应用程序的调试,并且我想为应用程序商店制作一个发布版本。不过,我总是忘记使用哪个菜单项。这个答案对我和其他人下次都是一个提醒。
从活动方案菜单中选择通用 iOS 设备。
然后转到产品>;存档。
您可能需要等待一段时间,Xcode 才能完成项目的归档。之后,您将看到一个包含已存档项目的对话框。您可以选择分发应用程序...并按照提示操作。
更多帮助
此答案适用于那些已经注册了开发者帐户并且只需要从 Xcode 获取存档到 iTunes Connect 的人。如果您在注册开发者帐户并将应用程序上架到应用程序商店方面需要更多帮助,请阅读以下链接。
Xcode 11
I found this question because I had already finished debugging my app and I wanted to make a release build for the app store. I always forget which menu item to use, though. This answer is a reminder to me and others next time.
Choose the Generic iOS Device from the active scheme menu.
Then go to Product > Archive.
You may have to wait a little while for Xcode to finish archiving your project. After that you will be shown a dialog with your archived project. You can select Distribute app... and follow the prompts.
More Help
This answer is for those who are already all signed up with a developer account and just need to get the archive from Xcode to iTunes Connect. If you need more help signing up for a developer account and getting an app to the app store, read the following links.
它是通过构建存档版本来完成的。
首先将 iOS 设备连接到您的 Mac。然后在 Xcode 中选择该设备作为目标。
现在单击“产品”选项卡,然后单击“存档”
It is done over building an Archive version.
First connect a iOS device to your Mac. Then select that device as target in Xcode.
Now click on the tab "Product" and click on "Archive"
将原始答案保留在下面,但很长一段时间以来,这并不是创建“发布”二进制文件以在 Xcode 之外分发的推荐方法 - 对于您想要存档的文件:请参阅答案上面。
如果您希望在 Xcode 中调试/测试发布版本,此方法仍然相关。
要创建发布版本,您必须编辑您当前的方案 (⌘<) 并突出显示“运行[应用程序名称]。像往常一样,选择“构建配置”并选择“发布”。
Leaving the original answer below, but this has not been the recommended method to create a "release" binary for distribution outside of Xcode in a long time — for that you want to Archive: see answers above.
If you are looking to debug/test a Release build in Xcode, this approach is still relevant.
To create a release build, you have to edit your current scheme (⌘<) and highlight "Run [name of application]. On the right, select "Build Configuration" and choose "Release". Build as usual.
如果有人需要了解如何进行临时构建,请执行以下快速步骤
然后
观看快速视频https://jumpshare.com/v/rHLJII2npwyHCgGCabQA
If any one needs to go through how to make Adhoc build, here are quick steps
then
See quick video https://jumpshare.com/v/rHLJII2npwyHCgGCabQA
请按照以下步骤操作: -
确保通过此操作,如果您与系统断开连接,您可以在物理设备中运行构建。
但是如果您将在模拟器上运行相同的代码,那么您将面临一些错误,那么此时您需要将方案选项“发布”更改为“调试”
Follow these steps:-
Make sure Through this you can run build in your physical device if you are disconnected to System..
but if you will run the same code o n simulator then you will face some error then that time you need to change the scheme option Release to Debug
这是我创建发布版本的“更详细”步骤列表> (在一个具有许多方案和环境的团队和项目中工作)
我使用名为“的 Apple 代理”运输者'那将 iPA 上传到 Appstore 非常容易
发布愉快!
Here is my 'more detailed' list of steps for creating a release build > (Working on a team and a project that has many schemes and environments)
I use an apple proxy named 'transporter' that is pretty easy for uploading iPA to Appstore
Happy releasing!