Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to re-sign the ipa file?

How do I sign the .ipa file with a provisioning profile after I generate an IPA like the following with a different provision profile? I would like to sign the IPA with an ad-hoc provisioning profile for beta testing, and then re-sign the exact IPA with an app submission provisioning profile for the 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}" 
like image 484
Johnny Avatar asked Mar 01 '11 21:03

Johnny


People also ask

How do I change the Apple ID associated with an IPA file?

There is no solution. The original AppleID is used in the DRM process used when the app is purchased. You can't simply change it.


1 Answers

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:

CODESIGN_ALLOCATE=`xcrun --find codesign_allocate`; export CODESIGN_ALLOCATE 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 # replace the provision cp "$PROVISION" Payload/*.app/embedded.mobileprovision # sign with the new certificate (--resource-rules has been deprecated OS X Yosemite (10.10), it can safely be removed) /usr/bin/codesign -f -s "$CERTIFICATE" Payload/*.app # zip it back up zip -qr resigned.ipa Payload 

Your new signed app is called resigned.ipa

like image 185
Bruno Bronosky Avatar answered Sep 20 '22 13:09

Bruno Bronosky