Skip to content

Instantly share code, notes, and snippets.

@behdaad
Created March 23, 2019 15:15
Show Gist options
  • Save behdaad/4bd8729701d054c72720b5eff0be47df to your computer and use it in GitHub Desktop.
Save behdaad/4bd8729701d054c72720b5eff0be47df to your computer and use it in GitHub Desktop.
Resign IPA file
IPA="/path/to/file.ipa"
PROVISION="/path/to/file.mobileprovision"
CERTIFICATE="Name of certificate: To sign with" # must be in keychain
# unzip the ipa
unzip -q "$IPA"
# remove the signature
rm -rf Payload/*.app/_CodeSignature Payload/*.app/CodeResources
# replace the provision
cp "$PROVISION" Payload/*.app/embedded.mobileprovision
# sign with the new certificate
/usr/bin/codesign -f -s "$CERTIFICATE" --resource-rules Payload/*.app/ResourceRules.plist Payload/*.app
# zip it back up
zip -qr resigned.ipa Payload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment