Skip to content

Instantly share code, notes, and snippets.

@langford
Created February 5, 2015 17:48
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 langford/70c9c8c735eae310ef8d to your computer and use it in GitHub Desktop.
Save langford/70c9c8c735eae310ef8d to your computer and use it in GitHub Desktop.
Build production, passing "FORCE_PROD" environment variable (which I pass to the preprocessor in my build scheme)
#!/bin/sh
OUTPUTDIR="$HOME/Desktop/The_App"
APPNAME="The_App"
SCHEME="The_App"
SRCROOT=`pwd`
APP_WORKSPACE="$SRCROOT/The_App.xcworkspace"
ARCHIVE_PATH="$OUTPUTDIR/$APPNAME-production.xcarchive"
rm -f "$OUTPUTDIR/$APPNAME-production.ipa"
mkdir -p $OUTPUTDIR
xcodebuild clean && xcodebuild -workspace "$APP_WORKSPACE" -scheme "$SCHEME" archive -archivePath "$ARCHIVE_PATH" FORCE_PROD=1 && xcodebuild -exportArchive -exportFormat ipa -archivePath "$ARCHIVE_PATH" -exportPath "$OUTPUTDIR/$APPNAME-production.ipa" -exportProvisioningProfile 'The_App Adhoc Prov File'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment