简体   繁体   中英

Resign distribution IPA with developer IPA

I have a requirement of resigning an IPA from Distribution provisioning profile to developer provisioning profile.

I have tried iResign. But I iResign failed to do the Distribution to developer provisioning profile resigning.

The purpose of this requirement is to do performance testing of the IPA in Instrument.

I'm assuming you've already generated a separate provisioning profile from Apple (developer.apple.com).

You might want to put your ipa and provisioning profile in an empty folder for these steps.

Unpack the ipa, replace the embedded provisioning profile:

unzip "App.ipa"
rm -f "Payload/App.app/*.mobileprovision"
cp "DEV.mobileprovision" "Payload/App.app/embedded.mobileprovision"

If your dev profile uses a different bundle ID or BuildTeam:

/usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier <dev bundle ID>" Payload/*.app/Info.plist
/usr/libexec/PlistBuddy -c "Set BuildTeam <team ID>" Payload/*.app/AppInfo.plist

Extract the entitlements and put them in temp plists, if you're using a wildcard provisioning profile, also replace the wildcard with your bundle ID:

security cms -D -i Payload/*.app/embedded.mobileprovision > PP.plist 2>&1
sed -i '' "s/\*/<bundle ID>/g" PP.plist
/usr/libexec/PlistBuddy -x -c "Print Entitlements" PP.plist > entitlements.plist 2>&1

Code sign app, repack ipa, remove temp Payload and plists:

/usr/bin/codesign --force --preserve-metadata=identifier,entitlements --sign "<signing ID>" --entitlements entitlements.plist -i "<bundle ID>" Payload/*.app
zip -r "ShinyNewApp.ipa" Payload
rm -rf Payload
rm -f *.plist

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM