Created
February 1, 2015 15:18
-
-
Save noamtm/5c3aaa0b615477162ccd to your computer and use it in GitHub Desktop.
iOS: Re-sign an app for distribution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is not a ready-to-run script. It just shows the relevant command-line calls. | |
| XC_WORKSPACE=path/to/MyApp.xcworkspace | |
| XC_SCHEME=MyApp | |
| XC_CONFIG=Release | |
| ARCHIVE_PATH=dest/path/to/MyApp.xcarchive | |
| EXPORT_PATH=dest/path/to/MyApp.ipa | |
| DIST_PROFILE=NameOfDistributionProfile | |
| # Build and archive. This can be done by regular developers, using their developer key/profile. | |
| xcodebuild -workspace $XC_WORKSPACE -scheme $XC_SCHEME -sdk iphoneos -configuration $XC_CONFIG archive -archivePath $ARCHIVE_PATH | |
| # Export to IPA: Takes the above archive an re-signs the app using the provided profile (xcode tries to find a matching key). | |
| xcodebuild -exportArchive -exportFormat IPA -archivePath $ARCHIVE_PATH -exportPath $EXPORT_PATH -exportProvisioningProfile "$DIST_PROFILE" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately, use of
-exportProvisioningProfileis deprecated in Xcode 7, without functionally equivalent replacement and in favor of-exportOprionsPlist. However,-exportOprionsPlistdoes not allow to choose a different provisioning profile. It is still possible to use-exportProvisioningProfileparameter, but export then works in a different way than with-exportOprionsPlistand results are quite undesirable. Application exported with-exportOprionsPlistis of 18MB size, while exported with-exportProvisioningProfileis of 90MB size.