简体   繁体   English

PackageApplication今天停止与OS X 10.10(Yosemite)一起使用

[英]PackageApplication stopped working with OS X 10.10 (Yosemite) today

UPDATE: The correct answer is probably this one: Xcode 6.1 error while building IPA 更新:正确的答案可能是这样的: 构建IPA时Xcode 6.1错误

Using Jenkins to build iOS projects from repositories since a few years. 几年来,使用Jenkins从存储库构建iOS项目。 Suddenly today a new error occurs, stopping builds. 今天突然发生一个新的错误,停止生成。

I think I based most of this setup on this tutorial way back: 我想我大部分的设置都是以本教程为基础的:

http://www.raywenderlich.com/22816/beginning-automated-testing-with-xcode-part-22 http://www.raywenderlich.com/22816/beginning-automated-testing-with-xcode-part-22

This step causes the error: 此步骤导致错误:

# 4
echo "*** Post build step 4"
/usr/bin/xcrun -sdk iphoneos PackageApplication \
-o "${IPA_DIR}/${PROJECT}.ipa" \
-verbose "${APP}" \
-sign "${SIGNING_IDENTITY}" \
--embed "${PROVISIONING_PROFILE}"

It's a bit tricky to look at the logs where the error occurs, but here it is: 查看发生错误的日​​志有些棘手,但这是:

### Codesigning '/Users/Shared/Jenkins/Home/jobs/myapp/workspace/myapp_adhoc_7.mobileprovision' with 'iPhone Distribution: mycompany Inc.'
+ /usr/bin/codesign --force --preserve-metadata=identifier,entitlements,resource-rules --sign iPhone Distribution: mycompany Inc. --resource-rules=/var/folders/y1/4hrpc2851b7dxn9bhlkhbrnr00007q/T/ipIxOjxE2z/Payload/myapp.app/ResourceRules.plist --entitlements /var/folders/y1/4hrpc2851b7dxn9bhlkhbrnr00007q/T/ipIxOjxE2z/entitlements_plistYdluSmqT /var/folders/y1/4hrpc2851b7dxn9bhlkhbrnr00007q/T/ipIxOjxE2z/Payload/myapp.app
Program /usr/bin/codesign returned 1 : [Warning: usage of --preserve-metadata with option "resource-rules" (deprecated in Mac OS X >= 10.10)!
Warning: --resource-rules has been deprecated in Mac OS X >= 10.10!
/var/folders/y1/4hrpc2851b7dxn9bhlkhbrnr00007q/T/ipIxOjxE2z/Payload/myapp.app/ResourceRules.plist: cannot read resources
]
error: /usr/bin/codesign --force --preserve-metadata=identifier,entitlements,resource-rules --sign iPhone Distribution: mycompany Inc. --resource-rules=/var/folders/y1/4hrpc2851b7dxn9bhlkhbrnr00007q/T/ipIxOjxE2z/Payload/myapp.app/ResourceRules.plist --entitlements /var/folders/y1/4hrpc2851b7dxn9bhlkhbrnr00007q/T/ipIxOjxE2z/entitlements_plistYdluSmqT /var/folders/y1/4hrpc2851b7dxn9bhlkhbrnr00007q/T/ipIxOjxE2z/Payload/myapp.app failed with error 1. Output: Warning: usage of --preserve-metadata with option "resource-rules" (deprecated in Mac OS X >= 10.10)!
Warning: --resource-rules has been deprecated in Mac OS X >= 10.10!
/var/folders/y1/4hrpc2851b7dxn9bhlkhbrnr00007q/T/ipIxOjxE2z/Payload/myapp.app/ResourceRules.plist: cannot read resources

I'll try to fix this myself and later add the solution here, but in case anyone is faster than me please go ahead. 我将尝试自己解决此问题,然后在此处添加解决方案,但是如果有人比我快,请继续。

  • I have not specified --resource-rules in any settings. 我没有在任何设置中指定--resource-rules。 I guess xcrun uses this setting on its own, even though it is deprecated. 我猜xcrun会单独使用此设置,即使它已弃用。

Instead of using xcrun , you can use xcodebuild to create an archive and then run xcodebuild again to create the IPA file. 除了使用xcrun ,您还可以使用xcodebuild创建档案,然后再次运行xcodebuild创建IPA文件。

# Create an archive
xcodebuild -alltargets -configuration "${CONFIGURATION}" -scheme "${SCHEME}" -archivePath "${APP_PATH}/${PROJECT}.xcarchive" archive

# Create the IPA file from the archive
xcodebuild -exportProvisioningProfile "${PROVISIONING_PROFILE_NAME}" -exportArchive -exportFormat IPA -archivePath "${APP_PATH}/${PROJECT}.xcarchive" -exportPath "${IPA_DIR}/${PROJECT}.ipa" CODE_SIGN_IDENTITY="${SIGNING_IDENTITY}"

Note that ${PROVISIONING_PROFILE_NAME} should contain the name of the provisional profile, and not the path to the file itself. 请注意, ${PROVISIONING_PROFILE_NAME}应该包含临时配置文件的名称,而不是文件本身的路径。

Found the answer. 找到了答案。

The problem that occurred now was the "xcrun PackageApplication" something something line. 现在发生的问题是“ xcrun PackageApplication”问题。 I had to remove the "-sign some profile" parameter, then things started working again. 我必须删除“ -sign some profile”参数,然后事情再次开始工作。

That said I don't know why signing was necessary before, and why it isn't now so can't tell if this is going to cause some problem later. 那就是说,我不知道为什么以前需要签名,为什么现在不需要签名,所以无法确定这以后是否会引起一些问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM