如何在 xcode 4 中完全自动化从构建到 .ipa 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6317089/
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-14 21:14:50  来源:igfitidea点击:

How to fully automate from build to .ipa file in xcode 4

iosxcodexcode4build-automation

提问by Roger Gilbrat

In xcode 3, using a bash script, I could run xcode from the command line, then take the files in the build directory and zip them up into a .ipa file, allowing for a fully automated build process for my adhoc iOS distribution. Anytime there is human intervention, there is the possibly for error.

在 xcode 3 中,使用 bash 脚本,我可以从命令行运行 xcode,然后获取构建目录中的文件并将它们压缩到 .ipa 文件中,从而为我的临时 iOS 发行版提供完全自动化的构建过程。任何时候有人工干预,都有可能出错。

Under xcode 4, this seem to be not possible anymore. The build directory has been replaced with a DerivedBuilds folder and it uses some obfuscation naming, so it's not possible to let an external script find the files.

在 xcode 4 下,这似乎不再可能了。构建目录已替换为 DerivedBuilds 文件夹,它使用了一些混淆命名,因此不可能让外部脚本找到文件。

In xcode 4, after the build, I need to run Produce->Archive, then selected the file in the organizer, then select save, then navigate to the final folder and name the file and hit save. This is a very error prone process better left to machines.

在 xcode 4 中,构建后,我需要运行 Produce->Archive,然后在管理器中选择文件,然后选择保存,然后导航到最终文件夹并命名文件并点击保存。这是一个非常容易出错的过程,最好留给机器处理。

So, is there a way to go from a clean build all the way to a signed .ipa file? I've got to believe this is possible, there is no way people with automated build processes are having to do this step by hand.

那么,有没有办法从干净的构建一直到签名的 .ipa 文件?我必须相信这是可能的,具有自动化构建过程的人不可能必须手动执行此操作。

Does anyone know how to do this?

有谁知道如何做到这一点?

采纳答案by Jonah

Sure, the script I have been using in my continuous integration environment is available at https://gist.github.com/949831That might do more than you need but should be able to serve as a base for whatever steps you want to include in your build process.

当然,我在持续集成环境中使用的脚本可以在https://gist.github.com/949831上找到,这可能比你需要的更多,但应该能够作为你想要包含的任何步骤的基础在您的构建过程中。

As you noted it would be hard to predict the derived data path Xcode will use but it is not too hard to located it in the build output as part of the build script.

正如您所指出的,很难预测 Xcode 将使用的派生数据路径,但将它作为构建脚本的一部分定位在构建输出中并不难。