Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I believe I have found a way to do exactly what you want, I haven't done extensive testing or tried to upload to the app store but from the testing I have done it seems to be good. The resign and the addition of my provisioning profile is working as I can install it on my devices defined in the AdHoc profile with no manual profile installation needed. Second test was I got an iPad and an iPhone version of an app with the same bundle ID from xCode, at first I could not have both in iTunes but after the resign and bundle ID change I was able to have both installed. I also tried changing the app name and that worked as well, it showed on the device and in iTunes with the new name. Below is my script, it's designed to resign a specific app for me, so the profile and bundleID are hardcoded. I flip between an iPhone and iPad version of the app so I added that as a parameter to the script. But you should be able to take the principles I have here and refine them for yourself.</p> <p>The guts of this builds upon articles like <a href="http://dansdevdiary.tumblr.com/" rel="nofollow">Further adventures in resigning for iOS from Dan's Dev Diary</a> and very similar to Erica Sadun's App Signer listed above. The main addition I made was the editing of the Info.plist prior to resigning.</p> <pre><code>#!/bin/sh DestFile="Signed_$1" SigningCertName="YOUR DISTROBUTION CERT NAME HERE FROM KEYCHAIN" AppInternalName="APP NAME FROM INSIDE PAYLOAD FOLDER.app" echo echo "Going to take the app $1 and resign it as $DestFile" echo if [ "$2" = "iphone" ] ; then echo "Using iPhone Profile" echo BundleID="com.YOURCOMPANY" ProvProfile="/Users/YOURNAME/Library/MobileDevice/Provisioning Profiles/PROVISIONINGPROFILE.mobileprovision" elif [ "$2" = "ipad" ] ; then echo "Using iPad Profile" echo BundleID="com.YOURCOMPANY.ipad" ProvProfile="/Users/YOURNAME/Library/MobileDevice/Provisioning Profiles/PROVISIONINGPROFILE_iPad.mobileprovision" else echo "You must enter either iphone or ipad as the second parameter to choose the profile to sign with." echo exit 1 fi rm -f Resigned.ipa unzip -q $1 -d temparea cd temparea/Payload echo "*** Original Signing ***" echo "************************" codesign -d -vv $AppInternalName/ cp "$ProvProfile" ./$AppInternalName/embedded.mobileprovision export EMBEDDED_PROFILE_NAME=embedded.mobileprovision export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate #Update the Info.plist with the new Bundle ID sed 's/&gt;ORIGINAL BUNDLEID HERE&lt;/&gt;'$BundleID'&lt;/' ./$AppInternalName/Info.plist &gt;./$AppInternalName/Info.plist.new mv -f ./$AppInternalName/Info.plist.new ./$AppInternalName/Info.plist # this will do a rename of the app if needed # sed 's/&gt;ORIGINAL APP NAME&lt;/&gt;NEW APP NAME&lt;/' ./$AppInternalName/Info.plist &gt;./$AppInternalName/Info.plist.new # mv -f ./$AppInternalName/Info.plist.new ./$AppInternalName/Info.plist # echo "Hit enter to proceed with signing." # read TMP codesign -f -vv -s "$SigningCertName" -i $BundleID $AppInternalName echo echo "*** New Signing ***" echo "*******************" codesign -d -vv $AppInternalName/ cd .. zip -r -q ../Resigned.zip . cd .. rm -R temparea mv Resigned.zip $DestFile echo echo "New IPA Created, $DestFile" </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload