持续集成代码签名问题

时间:2012-09-14 18:16:37

标签: xcode continuous-integration xcrun

我一直在为我的iOS版本设置一个TeamCity持续集成构建代理,而且我遇到了一些障碍。

我们将为具有不同证书和移动配置文件的不同客户端进行构建,因此我想我会编写一个构建脚本来创建一个未签名的存档,然后使用适当的身份和mobileprovision对其进行签名。似乎xcrun命令不喜欢.app文件没有签名,因此不会签名。

我做错了什么,还是有其他更优雅的方式来完成我想做的事情?

Infodump跟随......


我正在使用以下命令创建未签名的构建:

xcodebuild -workspace "[workspace].xcworkspace" -scheme "[scheme]" clean archive CODE_SIGN_ENTITY="" CODE_SIGNING_REQUIRED=NO

然后,我正在尝试使用此命令对代码进行编码并创建IPA:

APP=[path to .app file in archive]
OUT_IPA=[desired location of .ipa]
IDENTITY=[CodeSigning Identity]
MOBILE_PROVISION=[path to .mobileprovision]
xcrun -sdk iphoneos PackageApplication -v "${APP}" -o "${OUT_IPA}" --sign "${IDENTITY}" --embed "${MOBILE_PROVISION}"

xcrun命令打印一堆调试信息,然后将文件复制到临时目录。然后它检查原始应用程序

### Checking original app

+ /usr/bin/codesign --verify -vvvv /Users/jibanez/Library/Developer/Xcode/Archives/2012-09-14/[scheme] 9-14-12 12.02 PM.xcarchive/Products/Applications/[product].app
Program /usr/bin/codesign returned 1 : [/Users/jibanez/Library/Developer/Xcode/Archives/2012-09-14/[scheme] 9-14-12 12.02 PM.xcarchive/Products/Applications/[product].app: code object is not signed at all
In architecture: armv7
]
Codesign check fails : /Users/jibanez/Library/Developer/Xcode/Archives/2012-09-14/[scheme] 9-14-12 12.02 PM.xcarchive/Products/Applications/[product].app: code object is not signed at all
In architecture: armv7

Done checking the original app

这似乎是正确的。毕竟,我没有对存档进行代码签名,这就是xcrun应该做的事情。这就是事情变得奇怪的地方:

### Embedding '/Users/jibanez/Documents/[projectdir]/codesign/[scheme]/842F2922-D0CB-46CE-81E5-B7362DD1D960.mobileprovision'
+ /bin/rm -rf /var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app/embedded.mobileprovision
Program /bin/rm returned 0 : []
+ /bin/cp -rp /Users/jibanez/Documents/[projectdir]/codesign/[scheme]/mobileProvision.mobileprovision /var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app/embedded.mobileprovision
Program /bin/cp returned 0 : []
+ /usr/bin/codesign -d --entitlements /var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/entitlements_rawwAdCadPV /var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app
Program /usr/bin/codesign returned 1 : [/var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app: code object is not signed at all
]
error: Failed to read entitlements from '/var/folders/hh/qhf8930s5hg8lwbp2j_zsdm822y1s1/T/NycIiYdEYe/Payload/[product].app'
Failed: PackageApplication

0 个答案:

没有答案