xcode 在开发设备上运行 iOS 应用的发布版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19185540/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:00:50  来源:igfitidea点击:

Run release build of iOS app on development device

iosxcodexcode4.5

提问by Mr. Boy

When I build my iPad app for running on my development iPad, it only builds the debug version. I need to see how fast the real release version is; how do I do this? I'm used to Visual Studio's Debug/Release builds, so this Run/Test/Profile/Analyze/Archive stuff isa bit confusing. I see Schemes are related to this but isn't there a simple switch "I want to test Debug/Release version of my app on my device"?

当我构建我的 iPad 应用程序以在我的开发 iPad 上运行时,它只构建调试版本。我需要看看真正的发布版本有多快;我该怎么做呢?我习惯了 Visual Studio 的调试/发布版本,所以这个 Run/Test/Profile/Analyze/Archive 的东西有点令人困惑。我看到 Schemes 与此相关,但是没有一个简单的开关“我想在我的设备上测试我的应用程序的调试/发布版本”?

采纳答案by Mongo

You want to do a release build using an ad-hoc provisioning profile, which will allow you to install it on your device and any others you have specified.

您想使用临时配置文件进行发布构建,这将允许您将其安装在您的设备和您指定的任何其他设备上。

Test flight appis free and can help with this process as well.

试飞应用程序是免费的,也可以帮助完成此过程。

Provisioning Profile

配置文件

回答by Leo Natan

In your scheme settings, you can select to build for debug or release. Make sure you have set up code signing correctly. Xcode 5 can help with that.

在您的方案设置中,您可以选择为调试或发布而构建。确保您已正确设置代码签名。Xcode 5 可以提供帮助。

回答by unspokenblabber

You can create a new Build Configurationin the Project Viewunder the Xcode Project. Make it a duplicate of Distribution

您可以创建一个新Build ConfigurationProject ViewXcode Project。使它成为一个副本Distribution

New configuration

新配置

Then just choose Edit Schemesand choose the new scheme and run on your device. Make sure you the certificates selected in your Build Settings. However you don't get full Debugging capabilities when running a AdHoc/ Distributionbuild.

然后只需选择Edit Schemes并选择新方案并在您的设备上运行。确保您在Build Settings. 但是,在运行AdHoc/Distribution构建时,您无法获得完整的调试功能。

回答by Eric Wiener

This took me a really long time, but I got it working. I usually use automatic signing and it works great. I switched to using FastLane in order to speed up the test flight distribution process and it required that I switch to manual signing. I had to change my release signing certificate to iOS Distribution.

这花了我很长时间,但我得到了它的工作。我通常使用自动签名,效果很好。我改用 FastLane 以加快试飞分发过程,这要求我改用手动签名。我不得不将我的发行签名证书更改为 iOS 发行版。

I then had a bug that was only reproducible in release mode, so I needed to run the app on my device in release mode, but it was a pain to keep re-uploading to test flight.

然后我遇到了一个只能在发布模式下重现的错误,所以我需要在我的设备上以发布模式运行该应用程序,但是不断重新上传以进行试飞很痛苦。

I tried changing my build system to legacy, but that didn't work. I read up on profiles and certificates and I realized that I need to use iOS development certificates to run on device directly (which is what I was doing in debug mode). However, I needed to use iOS distribution certificates to distribute the app. Automatic signing had been taking care of this for me.

我尝试将我的构建系统更改为旧版,但这没有用。我阅读了配置文件和证书,我意识到我需要使用 iOS 开发证书直接在设备上运行(这是我在调试模式下所做的)。但是,我需要使用 iOS 分发证书来分发应用程序。自动签名一直在为我解决这个问题。

I ended up just turning on automatic signing briefly to test my app and then turned it back off and used git to revert the status of the workspace.

我最终只是简单地打开自动签名来测试我的应用程序,然后将其关闭并使用 git 恢复工作区的状态。

TLDR: turn on automatic signing and then turn it back off when done testing

TLDR:打开自动签名,然后在完成测试后将其关闭