Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
339 views
in Technique[技术] by (71.8m points)

ios - Code Signing Resource Rules Path fails on Jenkins, CODE_SIGN_RESOURCE_RULES_PATH

I am little concerned about how people treat the following issue.

Basically it sounds like "Build fails on Jenkins with the ResourceRules.plist: cannot read resources"

My circumstances are:

1) Jenkins

2) Locally I work in Xcode 7 beta (on a separate branch)

3) My teammates work in 6.4.1 and for them everything works fine

4) Jenkins slave has Xcode 6.4.1 installed

Some of you will say "this question was asked millions of times", like here, here, here, here.

But the documentation says the following:

Resource Rules

Systems before OS X Mavericks v10.9 documented a signing feature (--resource-rules) to control which files in a bundle should be sealed by a code signature. This feature has been obsoleted for Mavericks. Code signatures made in Mavericks and later always seal all files in a bundle; there is no need to specify this explicitly any more. This also means that the Code Signing Resource Rules Path build setting in Xcode should no longer be used and should be left blank.

So my question is why everybody is so quick on hand to bypass, hack, workaround this issue, when the documentation clearly says that is should be blank and it's obsolete?

What is the real problem behind this? Why the build fails on something that is not required for several years?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I had the same problem. The solution suggested by Mr.Dan Cutting here works for me.

Just to save some time, here is what we need from the web link.

"As of Mavericks, the resource-rules option should not be included when signing apps, but for some reason the script still passes this option along to the code signing tool.

The workaround is to alter the PackageApplication script so it no longer does this (which will require sudo access). Line 155 of the script constructs the parameters to pass through to the code signer, so we can simply remove the references to resource-rules:"

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

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...