- 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
- Replace Provisioning Profile
$ unzip MyApp.ipa
$ rm -rf Payload/MyApp.app/_CodeSignature
$ cp path/to/MyProfile.mobileprovision Payload/MyApp.app/embedded.mobileprovision
- 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
- Pack
$ zip -qr MyApp-resigned.ipa Payload