assign new provision profile to ipa after the old one is expired

1.2k views Asked by At

I got an Ipa and the provision profile of the app that is expired, I've created a new provision profile on apple, is there a way to assign the new one to the current Ipa? without configuring it in xcode

2

There are 2 answers

0
wottle On

You should be able to swap out the embedded.mobileprovision file in the ipa, then re-sign the app. You have a couple of options to do this:

  1. The easiest solution is to use the fastlane's resign tool.

  2. You can write a shell script to manually extract the contents of the IPA, replace the provisioning profile, then call codesign to re-sign the binary. More details can be found here.

0
Carrione On

You can use this shell script (Thank you Daniel Torrecillas).

  1. prepare a directory,
  2. add your old ipa file, a new provisioning profile (.mobileprovision) and a downloaded shell script to the directory,
  3. open a terminal in the directory,
  4. add permissions to the script in the terminal using the command
chmod 755 resign-ios-app
  1. call the script with 3 or 4 parameters: 1- the path of the old ipa file, 2- the path of the new provisioning profile, 3- the name of the distribution certificate in the Keychain, 4 is optional - the new bundle identifier.
./resign-ios-app 'olderIpaFileName.ipa' 'newProvisioningProfileFileName.mobileprovision' 'Apple Distribution: TeamName (teamID)'

As a result, you get the resigned.ipa file into the directory where the shell script is (it is your working directory from step 1).

Now you can use the resigned ipa file and delete your work directory from step 1.

Note: The script creates several subdirectories and plists. They are important only for the script itself. You can delete them.