69

I tried to resign my ipa file with new provisioning profile on Mac Os 10.10 with iResign app but I got this warning: "Warning: --resource-rules has been deprecated in Mac OS X >= 10.10".

What should I do now?

Charlie Brumbaugh
  • 219
  • 1
  • 5
  • 15
hiennv92
  • 810
  • 1
  • 8
  • 12
  • What files are you excluding from signing? – Droppy Oct 20 '14 at 06:50
  • I have an ipa file with development cerfiticate, now I want to change it to an enterprise distribution cerfiticate. I used iResign app to resign on Mac OS X 10.10 but it shows that warning. – hiennv92 Oct 20 '14 at 08:08
  • Sounds like a bug in `iResign` (whatever that is) and you should probably be rebuilding the app using Xcode instead? – Droppy Oct 20 '14 at 08:17
  • Thanks for your support. But some of my friends don't know how to build with Xcode. It's better if they can resign ipa file with their distribution cerfiticate. I will suggest they use Mac OS 10.9.5 or below. Anyway, thankyou very much – hiennv92 Oct 20 '14 at 08:52

8 Answers8

153

Click on your project > Targets > Select your target > Build Settings >

Code Signing Resource Rules Path

and add :

$(SDKROOT)/ResourceRules.plist

enter image description here

Dani Pralea
  • 4,545
  • 2
  • 31
  • 49
  • Any explanation behind what exactly changed to cause this error? – Jeff Ames Oct 21 '14 at 20:54
  • Not sure. I think it's Apple's engineers you should ask hehe :) @Johannes: Are you sure you did the exact steps ? Not sure how I can actually help you, though I want that ... :( – Dani Pralea Oct 22 '14 at 07:35
  • 11
    This helped me solve an issue that I was having with TestFlight. – dfmuir Oct 22 '14 at 20:17
  • 2
    I don't see `Code Signing Resource Rules Path` there... Any ideas? – Georg Oct 27 '14 at 11:07
  • 4
    This seemed to have solved issues i was having with TestFlight – Joseph Oct 27 '14 at 14:58
  • 5
    go to `Build Settings` Georg and make sure you have all levels selected – Dani Pralea Oct 28 '14 at 11:01
  • 4
    This solved my problem using TestFlight for Mac when creating the IPA failed. It honestly feels like apple is slowly killing everything good about TestFlight. I thought it was gonna be a good thing when they acquired... – Cameron E Oct 29 '14 at 05:10
  • 1
    To save someone else some time 'Code Signing Resource Rules Path' is under the fourth section 'Code Signing'. – Chris Harrison Nov 07 '14 at 10:12
  • 2
    This did NOT work for me however I found my resolution. In my case I am building a Mac app. I recently migrated to a new iMac using a restore from Time Machine backup (not sure if that is relevant). I also am newly using XCode 6.1. In my case I went to the developer portal and registered my new Mac's UUID as a device and added that to my provisioning profile. Then I manually downloaded/installed that profile but it still did not work. THEN I went into XCode Preferences... Accounts, double-clicked my account and clicked the Refresh button. FINALLY I got the build to work. – Ty Jacobs Nov 11 '14 at 00:56
  • 2
    This answer does not apply to OS X targets, since the `ResourceRules.plist` file on Mac OS can be found few levels up in the `$(SDKROOT)` path. – Bojan Dimovski Nov 19 '14 at 13:32
  • 1
    @danipralea: Though the solution provided by you works just perfectly, I have one concern. I just came across the Apple's technical note from https://developer.apple.com/library/mac/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG401. It says that "Code Signing Resource Rules Path build setting in Xcode should no longer be used and should be left blank.". Please advice on this. Will the app be rejected by Apple if I use that flag. Is there anyway to remove that flag from codesign parameters? – Rashmi Ranjan mallick Jan 05 '15 at 14:39
  • 1
    My app was actually just approved with that setting. And it's not the only one – Dani Pralea Jan 06 '15 at 14:08
  • Added a screenshot because the Code Signing section can be tricky to find for the uninitiated (ie. me) – Mike Chamberlain Nov 10 '15 at 00:49
  • apple is now rejecting binaries that have this set. – LightningStryk Nov 30 '16 at 17:22
24

Since Xcode 7, the Code Signing Resource Rules Path build setting must be left empty or else this warning is produced.

Technical Note TN2206 provides the details:

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.

It is thus no longer possible to exclude parts of a bundle from the signature. Bundles should be treated as read-only once they have been signed.

Ricardo Sanchez-Saez
  • 9,466
  • 8
  • 53
  • 92
10

After Xcode 7 previous solutions stopped working. A new one was pointed by Rishi Goel (in https://stackoverflow.com/a/32762413/2252465)

  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});
    
Community
  • 1
  • 1
Rodrigo Pinto
  • 2,384
  • 22
  • 23
6

I found workaround: if you run the iResign app from XCode — then you will resign app without problem (warning will appears in console instead of popup). But if you close XCode and run app alone — then popup will back to you!

BTW: bug found :) The condition

if (systemVersionFloat < 10.9f)

Is broken for Yosemite 10.10. Funny.

Thanks,

Sergey Kopanev
  • 1,496
  • 3
  • 17
  • 29
  • 1
    Thankyou very much! This is really a funny bug. I've found this bug recently. There is also new update here: https://github.com/maciekish/iReSign – hiennv92 Nov 01 '14 at 07:49
  • Where is the condition coming from? And how should I fix this condition? – munmunbb Oct 09 '15 at 23:23
  • This doesn't look like a bug as much as a hardcoded force-deprecation. – Lytic Jan 24 '17 at 19:28
4

Try adding below arguments in xcodebuild command.

-sdk iphoneos CODE_SIGN_RESOURCE_RULES_PATH='$(SDKROOT)/ResourceRules.plist' 
2

If you are resigning app using terminal then you can even omit resource-rules while performing code sign, as there is no need to externally specify which resource to sign and which to not. Now it is mandatory to sign all the resources inside package.

To resign app using terminal you can follow below steps:

unzip MyApp.ipa

rm -rf Payload/MyApp.app/_CodeSignature/

cp ~/Desktop/MyAdHoc.mobileprovision Payload/MyApp.app/embedded.mobileprovision 

codesign -f -s "iPhone Distribution: Code signing Certificate for Enterprise or Ad-hoc app" Payload/MyApp.app

zip -qr MyApp_Resigned.ipa Payload/
technerd
  • 14,144
  • 10
  • 61
  • 92
1

I just opened my existing iOS app in Xcode 7 GM (from Xcode 6.4) and saw this deprecation warning.

It's interesting that answers and comments are saying to update the 'Code Signing Resource Rules Path' and they also reference Mac apps.

In my case, the project had this key and value already set by default (I never set it). The warning is about resource rules being deprecated too.

For me, deleting the value of the 'Code Signing Resource Rules Path' removed the warning. I have not submitted a new build this way so I may have to come back and update this answer.

Just thought it was interesting that my answer is opposite what everyone else was seeing.

Chad Pavliska
  • 1,233
  • 12
  • 17
0

If you comment out the two --resource-rules parameters from the arguments list, where the iResign app calls the codesign task, then you don't have to change the project build settings for the app's project.

I don't like the idea of having to modify the build settings for every project I want to work with, just so that I can resign it.

I rebuilt the resign tool, and copied it to my Applications directory, so that I don't have to open it in Xcode.

Sheamus
  • 6,506
  • 3
  • 35
  • 61