Skip to content

Instantly share code, notes, and snippets.

@zhugexiaobo
Created April 23, 2024 03:06
Show Gist options
  • Save zhugexiaobo/df947c0b241dc535cf93c4ac3d832d2e to your computer and use it in GitHub Desktop.
Save zhugexiaobo/df947c0b241dc535cf93c4ac3d832d2e to your computer and use it in GitHub Desktop.
How to Resign an IPA
  1. Prepare New Signing Assets
$ security cms -D -i path/to/MyProfile.mobileprovision > provision.plist
$ /usr/libexec/PlistBuddy -x -c 'Print :Entitlements' provision.plist > entitlements.plist
  1. Replace Provisioning Profile
$ unzip MyApp.ipa
$ rm -rf Payload/MyApp.app/_CodeSignature
$ cp path/to/MyProfile.mobileprovision Payload/MyApp.app/embedded.mobileprovision
  1. Resign App
$ /usr/bin/codesign -f -s "iPhone Distribution: XXXXXXXXXX" --entitlements entitlements.plist Payload/MyApp.app/Frameworks/*
$ /usr/bin/codesign -f -s "iPhone Distribution: XXXXXXXXXX" --entitlements entitlements.plist Payload/MyApp.app
  1. Pack
$ zip -qr MyApp-resigned.ipa Payload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment