cea3fw
Last Updated: July 19, 2018
·
56.59K
· _jeffreyjackson
Profile

resign .ipa with new distribution certificate

Assumptions:

  1. .ipa filename is app.ipa
  2. app is called MyApp
  3. new provisioning profile resides at: ~/Downloads/AdHoc.mobileprovision
  4. distribution certificate name is Company Certificate
  5. may not need resource-rules parameter
  6. provisioning profile is either for Adhoc, or Enterprise distribution

Commands:

unzip app.ipa

rm -rf Payload/MyApp.app/_CodeSignature/

cp ~/Downloads/AdHoc.mobileprovision Payload/MyApp.app/embedded.mobileprovision 

codesign -f -s "iPhone Distribution: Company Certificate" --resource-rules Payload/MyApp.app/ResourceRules.plist  Payload/MyApp.app

zip -qr app-resigned.ipa Payload/
Say Thanks
Respond

15 Responses
Add your response

11867
50adc37a6c4d5923e3c34250f0694c70

Perfect directions. Thanks! May I suggest that you note that the signing identity (-s) is the full name of the certificate as shown via the keychain tool.

over 1 year ago ·
11870
50adc37a6c4d5923e3c34250f0694c70

One more thing... The codesign --entitlements option can be used to add entitlements to the binary. When I followed these directions without using --entitlements, I lost the original entitlements.

over 1 year ago ·
15224
B42e95482cbfad0e59138637eb0f3cf9

Hi Jeff,

Thank you for your post. pretty good.

Also, does this resining works for app store build ? I am finding way to resign the development build and upload it to app the store.

Thanks

over 1 year ago ·
15682
Dd2be197c83c9fb4e38cd328a8b0e0f5

If you run into issue like :
"cannot find code object on disk"

then set an environment variable

CODESIGNALLOCATE="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesignallocate"

NOTE : there is an underscore between codesign & allocate environment variable which is getting supressed for some reason.

over 1 year ago ·
17938
0 eokdzfbec6ymdsx3em5szubkg8rh7so3e0knzsxjj5fjkodtx4nl9dkc2au92g0dwjqcbosng t5

I got an ipa and I re-signed it with EXPIRED provisioning profile (Enterprise) and with a valid certificate(.p12). using steps mentioned below :-

and Re-Sign it with steps provided by you

when I am extracting ipa (getting .App file) -> doing show package Contents (on .App) -> checking content of embedded.mobileprovision. it show same expired provisioning profile that i used to Re-sign the ipa.

Problem : I am successfully able to install it to ipad and able to run the app. Ideally App should not work with Expired provisioning profile.

Question : If we Re-signing the app through Command-line with Expired profile Will it work.?

over 1 year ago ·
17983
None

Have you been able to codesign Today app extension?

over 1 year ago ·
29014

What is the ResourceRules.plist? Is it mandatory? We have the Info.plist and I am not sure if signing without --resource-rules will work.
Also, how do you handle Entitlement files when resigning? I tried --entitlements /Path/to/My.entitlements, but it seems to have no effect

over 1 year ago ·
29209

below issue

Warning: --resource-rules has been deprecated in Mac OS X >= 10.10!
Payload/MyApp.app/ResourceRules.plist: cannot read resources

11 months ago ·
29210

below issue

Warning: --resource-rules has been deprecated in Mac OS X >= 10.10!
Payload/MyApp.app/ResourceRules.plist: cannot read resources

11 months ago ·
29467

Great tutorial.
For those saying they have this error :

Warning: --resource-rules has been deprecated in Mac OS X >= 10.10!
Payload/MyApp.app/ResourceRules.plist: cannot read resources

Just get rid of the resource-rules parameter.

8 months ago ·
29471

Any update on the latest versions ? I tried that on the latest iOS and I followed the steps and all nice until the last part when to install it fails .

Thanks .

7 months ago ·
29858

Hi,
I received .ipa file from developer.I am new to iOS testing, Can you please let me know how to create or where to find provisioning profile and Company certificate.

3 months ago ·
29912

Thank you for your post ! really good article.
What is the ResourceRules.plist?
any idea ? please respond
thankyou
https://9apps.ooo/ https://tutuappx.com/ https://aptoide.vip/

2 months ago ·
30128

Wow, Really great post i enjoy it very much here I appreciating your knowledge keep sharing kindly check it out
https://kathrynhemphill199.wixsite.com/hanumanchalisalyrics

11 days ago ·
30157

Systems Manager suffer for the dispensation of initiative iOS apps that are not openly present in iTunes. Enterprise iOS apps are apps improved worn the iOS Enterprise Developer Program. A weighty Dun & Bradstreet (D-U-N-S) numeral is ask to register in this plant (more intelligence). This playbill like for revelation of inwardly make iOS apps. To unfold these in-audience entertain apps over-the-intelligence to order iOS clients, Systems Manager bestow users to either torch to a .plist march landlord on an accompanying common salver, or upload the .ipa row absolutely into Dashboard .


http://9apps.ind.in/

7 days ago ·