如何在 Xcode 中创建发布版本?

发布于 2024-11-02 06:34:16 字数 51 浏览 0 评论 0原文

为什么当我构建应用程序时,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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

宁愿没拥抱 2024-11-09 06:34:16

产品 / 方案 / 编辑方案..

“在此处输入图像描述”

然后从出现的菜单中,选择“构建配置”下的发布

在此处输入图像描述

Product / Scheme / Edit Scheme..

enter image description here

And from the menu that comes up, select Release under "Build Configuration".

enter image description here

终遇你 2024-11-09 06:34:16

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.

enter image description here

Then go to Product > Archive.

enter image description here

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.

眼泪淡了忧伤 2024-11-09 06:34:16

它是通过构建存档版本来完成的。

首先将 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"

痴情 2024-11-09 06:34:16

将原始答案保留在下面,但很长一段时间以来,这并不是创建“发布”二进制文件以在 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.

孤独患者 2024-11-09 06:34:16

如果有人需要了解如何进行临时构建,请执行以下快速步骤

产品>存档

然后

导出>保存为临时部署....

观看快速视频https://jumpshare.com/v/rHLJII2npwyHCgGCabQA

If any one needs to go through how to make Adhoc build, here are quick steps

Product > Archive

then

Export > Save for Ad Hoc Deployment ....

See quick video https://jumpshare.com/v/rHLJII2npwyHCgGCabQA

舟遥客 2024-11-09 06:34:16

请按照以下步骤操作: -

  1. 转到产品选项,
  2. 选择方案选项,
  3. 编辑方案选项
  4. ,将调试更改为发布,

确保通过此操作,如果您与系统断开连接,您可以在物理设备中运行构建。
但是如果您将在模拟器上运行相同的代码,那么您将面临一些错误,那么此时您需要将方案选项“发布”更改为“调试”

Follow these steps:-

  1. Go to product option
  2. select Scheme option
  3. Edit Scheme option
  4. change Debug to Release

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

红玫瑰 2024-11-09 06:34:16

这是我创建发布版本的“更详细”步骤列表> (在一个具有许多方案和环境的团队和项目中工作)

  1. 签出一个新分支,例如包含所有更改的releases/xxx。 (xxx 是版本)(更多关于您的团队约定)
  2. 检查以确保您的应用程序包标识符正确(每个环境可能有所不同)
  3. 团队/帐户/许可证:登录到具有配置文件的正确帐户。然后在签名和功能下确保您的团队被正确选择并拥有所需的所有证书
  4. 将项目设置中的版本升级到xxx
  5. 确保您选择的方案是正确的
  6. 确保API调用的URL指向您的发布环境
  7. 最好选择“任何 iOS 设备”,而不是模拟器或实际设备
  8. 如果有任何更改,请在本地提交任何更改(此步骤非常重要)
  9. 验证以确保一切正常
  10. 创建存档
  11. 为 AppStore Connect 分发您的应用程序

我使用名为“的 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)

  1. checkout a new branch like releases/x.x.x that contains all changes. (x.x.x is the version) (Its more about your team conventions)
  2. Check to make sure your app bundleIdentifier is correct (might differ for each environment)
  3. Team/account/licence: log into correct account that has provisioning profiles. then under signing and capabilities make sure your Team is correctly selected and has all certificates needed
  4. Upgrade the version in project settings to x.x.x
  5. Make sure the scheme you selected is correct
  6. Make sure the URLs of API calls are pointing to your release environment
  7. Its better to select 'Any iOS device' instead of a simulator or actual device
  8. Commit any changes locally if you have any (this step is very important)
  9. Validate to make sure all is good
  10. Create an archive
  11. Distribute your app for AppStore Connect

I use an apple proxy named 'transporter' that is pretty easy for uploading iPA to Appstore

Happy releasing!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文