Take the 2-minute tour ×

How do I sign the ipa file with a provision profile after I generate ipa like the following with a different provision profile? I would like to sign ipa with adhoc provision profile for beta testing, and then the exact ipa with app submission provision profile for app store.

/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${RELEASE_BUILDDIR}/${APPLICATION_NAME}.app" -o "${BUILD_HISTORY_DIR}/${APPLICATION_NAME}.ipa" --sign "${DEVELOPER_NAME}" --embed "${PROVISONING_PROFILE}"



share|improve this question

5 Answers 5

It's really easy to do from the command line. I had a gist of a script for doing this. It has now been incorporated into the ipa_sign script in https://github.com/RichardBronosky/ota-tools which I use daily. If you have any questions about using these tools, don't hesitate to ask.

The heart of it is this:

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

Your new signed app is called resigned.ipa

share|improve this answer
7 up votes and not a single question. I guess my bash is just that clear. –  Richard Bronosky Feb 5 '13 at 20:35
Indeed it is kind Sir. –  RuiAAPeres Mar 7 '13 at 14:12
im getting an error message saying "security: unable to open "/var/folders/74/kpcwmb6j1pn92kr8mtvm2mwh0000gn/T/./resign.I9DrKi7B/Payload/Atla‌​ntaJournal.app/embedded.mobileprovision" for reading: No such file or directory". –  Rahmathullah M Pulikkal Mar 14 '13 at 6:00
@RahmathullahMPulikkal I see I had errantly hardcoded a path in the gist. You really should be using github.com/RichardBronosky/ota-tools/blob/master/ipa_sign instead of the gist. It's the maintained code. –  Richard Bronosky Mar 29 '13 at 3:54
I got this error security: unable to open "/tmp/resign.MyApp.WObe2/my.mobileprovision" for reading: No such file or directory easily fixed by moving the cp up in the code. Thank you! –  Alberto M May 21 '13 at 13:25

Check iResign for an easy tool on how to do this!

[edit] after some fudling around, I found a solution to keychain-aware resizing. You can check it out at https://gist.github.com/Weptun/5406993

share|improve this answer
This worked for me. –  zekel Jan 7 '13 at 12:47
is there any tool which can change the Display name along with Bundle id while resigning? This will help to have different display names for different environements. like App-Dev, App-QA, App-Stage etc. –  Whizkid747 Apr 15 '13 at 16:10
Yes, the floatsign.sh does exactly that. –  LordT Apr 18 '13 at 21:24

Kind of old question, but with the latest XCode, codesign is easy:

$ codesign -s my_certificate example.ipa 

$ codesign -vv example.ipa
example.ipa: valid on disk
example.ipa: satisfies its Designated Requirement
share|improve this answer

Try this app http://www.ketzler.de/2011/01/resign-an-iphone-app-insert-new-bundle-id-and-send-to-xcode-organizer-for-upload/

It supposed to help you resign the IPA file. I tried it myself but couldn't get pass an error with Entitlements.plist. Could just be a problem with my project. You should give it a try.

share|improve this answer

You should try this new OSX app : AirSign.

It will help you to resign your IPA and share it directly over-the-air with your beta testers. If you choose to re-sign it manually, especially if you modify the Bundle Id of the app, you should really be carefull with apps entitlements (In some case, it could be complicated...).



share|improve this answer

Your Answer


