xcodebuild -scheme ${TARGET} archive DSTROOT="build"
直到Xcode升级到6.1,实在糊弄不过去了,一直提示:
2014-10-22 12:13:52.185 xcodebuild[5423:204362] [MT] DVTAssertions: Warning in /SourceCache/IDEFrameworks/IDEFrameworks-6604/IDEFoundation/Execution/Schemes/IDEScheme.m:1402 Details: Scheme <IDEScheme:0x7fc7653a49b0:'MyApp'> was asked to build and archive, but the run destination <IDERunDestination:0x7fc7653eca60:'iPad 2'> is not a deployment platform and this action shouldn't have been allowed. Object: <IDEScheme: 0x7fc7653a49b0> Method: -archiveOperationWithExecutionContext:onlyBuild:destination:overridingProperties:schemeCommand:buildLog:overridingBuildConfiguration:invocationRecord:name:title:error:actionCallbackBlock: Thread: <NSThread: 0x7fc760c2df20>{number = 1, name = main} Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide. xcodebuild: error: Failed to build project MyApp with scheme MyApp. Reason: You cannot archive for the iOS Simulator platform.
一开始以为是build setting设错了,修改armv6,armv7之类无效
后来意外发现,iPad2不就是6.1排在第一位的模拟器嘛,看来是6.1之后使用这条命令会默认指定模拟器为目标设备,只能乖乖上developer.apple.com补补课,就是这里了:
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcodebuild.1.html
脚本修改为下面这样之后,终于正常了:
xcodebuild -scheme ${TARGET} -destination generic/platform=iOS archive DSTROOT="build"