Skip to content

Instantly share code, notes, and snippets.

@WDUK
Last active May 5, 2024 16:40
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save WDUK/4239548f76bd77b2c4b0 to your computer and use it in GitHub Desktop.
Save WDUK/4239548f76bd77b2c4b0 to your computer and use it in GitHub Desktop.
How to re-sign an iOS Application
Here's what you do!
1. Terminal: Unzip the ipa (it's just a zip file after all)
unzip -q App.ipa
1a, You will need to have the entitlements file, this information is needed during signing.
codesign -d --entitlements :- "Payload/App.app"
2. Terminal: This will produce a `Payload/` directory. Remove the existing code signature.
rm -rf Payload/App.app/_CodeSignature
3. Terminal: You'll need a valid provisioning profile. Copy this into the payload.
cp <file>.mobileprovision Payload/App.app/embedded.mobileprovision
Note: If you've had a provisioning profile setup by Xcode 5, they're at the location
~/Library/MobileDevice/Provisioning\ Profiles/
4. Terminal: Now resign the application with your developer certificate.
The certificate name needs to match what's listed within Keychain Access.
/usr/bin/codesign -f -s "<Certificate Name>" --resource-rules Payload/App.app/ResourceRules.plist --entitlements Payload/App.app/Entitlements.plist Payload/App.app
6. Terminal: Rezip the newly signed app
zip -qr App.ipa Payload
7. Xcode: Get your device in the Organizer, and drag the .ipa to the Applications section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment