Jenkins + Xcode –resource-rules has been deprecated in Mac OS X >= 10.10!

Recently I tried to sign my iOS app with Apple Developer certificate through Jenkins with Xcode plugin and macmini as a slave.

Oh. I received a lot of different issues. I don't remember all of them, but the last one was:

+ /usr/bin/codesign --force --preserve-metadata=identifier,entitlements,resource-rules --sign iPhone Developer --resource-rules=/var/folders/4r/zbhyp88d4ds0dcwq7xk1p6r0l3xf3t/T/Kk61brhq91/Payload/app/ResourceRules.plist /var/folders/4r/zbhyp88d4ds0dcwq7xk1p6r0l3xf3t/T/Kk61brhq91/Payload/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/4r/zbhyp88d4ds0dcwq7xk1p6r0l3xf3t/T/Kk61brhq91/Payload/app/ResourceRules.plist: cannot read resources
]
error: /usr/bin/codesign --force --preserve-metadata=identifier,entitlements,resource-rules --sign iPhone Developer --resource-rules=/var/folders/4r/zbhyp88d4ds0dcwq7xk1p6r0l3xf3t/T/Kk61brhq91/Payload/app/ResourceRules.plist /var/folders/4r/zbhyp88d4ds0dcwq7xk1p6r0l3xf3t/T/Kk61brhq91/Payload/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/4r/zbhyp88d4ds0dcwq7xk1p6r0l3xf3t/T/Kk61brhq91/Payload/app/ResourceRules.plist: cannot read resources

Failed to build /var/jenkins/workspace/ios-ipa-test/build/MyApp-11.ipa
Build step 'Xcode' marked build as failure
Archiving artifacts
Finished: FAILURE

 

1. Remove CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist

2. Find the

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform

/Developer/usr/bin/PackageApplication script and update it.

Find the lines including the following code in the script

my @codesign_args = ("/usr/bin/codesign", "–force", "–preserve-metadata=identifier,entitlements,resource-rules",
"–sign", $opt{sign},
"–resource-rules=$destApp/ResourceRules.plist");

change it to:

my @codesign_args = ("/usr/bin/codesign", "–force", "–preserve-metadata=identifier,entitlements",
"–sign", $opt{sign});

 

Voilà!

vovando Avatar

Leave a Reply

Your email address will not be published. Required fields are marked *