Skip to content

Instantly share code, notes, and snippets.

@lodalo
Forked from noamtm/build-dist.sh
Last active August 29, 2015 14:18
Show Gist options
  • Save lodalo/05d75126410d66cdb7f9 to your computer and use it in GitHub Desktop.
Save lodalo/05d75126410d66cdb7f9 to your computer and use it in GitHub Desktop.
command line steps to build and re-sign an iOS app using a profile that the developer may not have (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