Xcode“构建和存档"从命令行 [英] Xcode "Build and Archive" from command line

查看:33
本文介绍了Xcode“构建和存档"从命令行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xcode 3.2 在 Build 菜单下提供了一个很棒的新功能,Build and Archive",它生成一个适合 Ad Hoc 分发的 .ipa 文件.您还可以打开管理器,转到存档的应用程序"和向 iTunesConnect 提交应用程序".

Xcode 3.2 provides an awesome new feature under the Build menu, "Build and Archive" which generates an .ipa file suitable for Ad Hoc distribution. You can also open the Organizer, go to "Archived Applications," and "Submit Application to iTunesConnect."

有没有办法从命令行(作为构建脚本的一部分)使用构建和存档"?我假设 xcodebuild 会以某种方式参与其中,但是 man 页面似乎没有对此进行任何说明.

Is there a way to use "Build and Archive" from the command line (as part of a build script)? I'd assume that xcodebuild would be involved somehow, but the man page doesn't seem to say anything about this.

更新 Michael Grinich 要求澄清;以下是命令行构建无法实现的功能,只有在构建和存档"后才能使用 Xcode 的管理器实现的功能.

UPDATE Michael Grinich requested clarification; here's what exactly you can't do with command-line builds, features you can ONLY do with Xcode's Organizer after you "Build and Archive."

  1. 您可以单击共享应用程序..."与 Beta 测试人员共享您的 IPA.正如 Guillaume 在下面指出的,由于 Xcode 的一些魔法,这个 IPA 文件不需要 beta 测试人员需要安装的单独分发的 .mobileprovision 文件;这很神奇.没有命令行脚本可以做到这一点.例如,Arrix 的脚本(5 月 1 日提交)不符合该要求.
  2. 更重要的是,在您对构建进行 Beta 测试后,您可以单击将应用程序提交到 iTunes Connect",将完全相同的构建提交给 Apple,即您测试的二进制文件,而无需重新构建它.这在命令行中是不可能的,因为签署应用程序是构建过程的一部分;您可以为 Ad Hoc beta 测试签名,也可以签名以提交到 App Store,但不能同时签名.任何基于命令行构建的 IPA 都不能在手机上进行 Beta 测试,然后直接提交给 Apple.

我希望有人来证明我是错的:这两个功能在 Xcode GUI 中运行良好,无法从命令行复制.

I'd love for someone to come along and prove me wrong: both of these features work great in the Xcode GUI and cannot be replicated from the command line.

推荐答案

我从命令行找到了如何自动化构建和归档过程,我刚刚写了一个 博客文章 解释了如何实现这一目标.

I found how to automate the build and archive process from the comand line, I just wrote a blog article explaining how you can achieve that.

你必须使用的命令是xcrun:

/usr/bin/xcrun -sdk iphoneos PackageApplication 
-v "${RELEASE_BUILDDIR}/${APPLICATION_NAME}.app" 
-o "${BUILD_HISTORY_DIR}/${APPLICATION_NAME}.ipa" 
--sign "${DEVELOPER_NAME}" 
--embed "${PROVISONING_PROFILE}"

您将在文章中找到所有详细信息.如果您有任何问题,请随时提出.

You will find all the details in the article. If you have any questions dont hesitate to ask.

这篇关于Xcode“构建和存档"从命令行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆