Skip to content

Instantly share code, notes, and snippets.

@scheinem
Last active April 16, 2017 14:54
Show Gist options
  • Save scheinem/1f2003f15d700a4f28a3d778417668a5 to your computer and use it in GitHub Desktop.
Save scheinem/1f2003f15d700a4f28a3d778417668a5 to your computer and use it in GitHub Desktop.
Re-Sign .ipa file with certificate from same or different Apple Developer Account
1. Unzip <File>.ipa
2. cd into the <File>.app inside the unzipped .ipa (= Payload Folder)
3. /usr/bin/security cms -D -i embedded.mobileprovision > ../Entitlements.plist (= Place the Entitlements next to <File>.app)
4. Remove outer dict only leaving inner dict „Entitlements“ in Entitlements.plist (also remove the "<key>Entitlements</key>")
5. Delete Folder "_CodeSignature" in <File>.app, in contained "Framework" folder and all .framework folders
6. Delete all .mobileprovision files in <File>.app, in contained "Framework" folder and all .framework folders
7. Add your <New>.mobileprovision as embedded.mobileprovision to <File>.app/
8. cd to location where Entitlements.plist and <File>.app are located
9. For each .framework and each .dylib: codesign -f -v -s "<Certificate Name>" --entitlements Entitlements.plist <fremworkOrDylibFile>
10. codesign -f -v -s "<Certificate Name>" --entitlements Entitlements.plist <File>.app
11. Name folder which contains Entitlement.plist and <AppName>.app „Payload“.
12. Zip this folder
13. Rename folder to <File>.ipa
14. Upload to store or anywhere your want
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment