使用归档时忽略xcodebuild参数 [英] xcodebuild arguments ignored when using archive
问题描述
我的名字是Luca,我目前正在开发iOS持续集成,使用shell脚本在xcode中构建应用程序(Ad Hoc和App Store)。
My name is Luca and I am currently working on iOS continuous integration to build apps in xcode for distribution (Ad Hoc and App Store) using shell-scripting.
到目前为止,我使用IPA文件取得了良好的效果。我的问题来分配在App Store。要从脚本(传递一些参数)构建一个.app,我可以:
So far I achieved good results with IPA files. My problem comes for distribution in App Store. To build a .app from script (passing some arguments) I do:
xcodebuild -scheme myScheme -configuration myConfiguration PRODUCT_NAME=myProductName TARGETED_DEVICE_FAMILY=myTargetedDeviceFamily .... etc
$ b $ p
从XCode 4.2开始,应用程序提交是使用XCode管理器窗口我必须也能够归档我的可执行文件。
Since with XCode 4.2, apps submission is done using the XCode Organizer Window I must be able also to archive my executable.
因此,我修改以前的命令行如下:
Therefore I modify the previous command line as follow:
xcodebuild -scheme myScheme -configuration myConfiguration PRODUCT_NAME=myProductName TARGETED_DEVICE_FAMILY=myTargetedDeviceFamily .... etc **archive**
不幸的是,我这样做后,似乎'archive'参数强制xcodebuild忽略其他(PRODUCT_NAME,TARGETED_DEVICE_FAMILY,....)和我的输出使用XCode预定义的构建设置构建。
Unfortunately after I do so, it seems that the 'archive' argument force xcodebuild to ignore the other ones (PRODUCT_NAME, TARGETED_DEVICE_FAMILY, ....) and my output is built using the XCode predefined build settings.
我想能够传递参数和xcodebuild并且有效,但是'archive'行为似乎阻止了这一点。
I want to be able to pass the arguments with xcodebuild and be effective, but the 'archive' action seems to prevent this.
我很抱歉,请帮助:)
感谢
推荐答案
xcodebuild的归档操作似乎在Xcode 4.2中有一个错误。通常,项目配置的覆盖可以通过命令行参数或通过 -xcconfig
参数指定。
The archive action for xcodebuild seems to have a bug in Xcode 4.2. Normally overrides for the project configuration can be specified as either command-line parameters or via the -xcconfig
parameter.
虽然 build 操作符合他们,但归档却没有。 (推测这是因为archive是一个元操作,它在内部调用构建,但不会将选项传递给内部调用。)有一个OpenRadar 错误描述这个问题,所以大概它已被报告给苹果。
Although the build action honors them, archive does not. (Presumably this is because archive is a meta-action that invokes build internally, but doesn't pass-through the options to the internal invocation.) There is an OpenRadar bug that describes this issue, so presumably it's been reported to Apple.
最后,请注意,如果你要去要使用脚本中的 archive 操作,那么您不能依赖xcodebuild的退出代码。归档操作总是生成一个退出代码0(成功,按照惯例)。要检测构建失败,您需要清除输出。
Finally, note that if you're going to use the archive action from a script then you can't rely on the exit code from xcodebuild. The archive action always yields an exit code of 0 (success, by convention). To detect build failure you need to scrape the output.
这篇关于使用归档时忽略xcodebuild参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!