Skip to content

Instantly share code, notes, and snippets.

@xingheng
Forked from noamtm/build-dist.sh
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xingheng/875b5f4c48cd0c289727 to your computer and use it in GitHub Desktop.
Save xingheng/875b5f4c48cd0c289727 to your computer and use it in GitHub Desktop.
iOS: Re-sign an app for distribution
# 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