Skip to content

Instantly share code, notes, and snippets.

@bradjasper
Created February 14, 2015 00:50
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bradjasper/b2af4762756a5df20524 to your computer and use it in GitHub Desktop.
Save bradjasper/b2af4762756a5df20524 to your computer and use it in GitHub Desktop.
Build, Archive & Export Mac App from command line (rather than Xcode)
#!/bin/bash
BASE_DIR=$HOME/Projects/focus
BUILD_DIR=$BASE_DIR/Builds
FOCUS_ARCHIVE=$BUILD_DIR/Focus.xcarchive
FOCUS_APP=$BUILD_DIR/Focus.app
echo "Building Focus..."
echo "Cleaning up old archive & app..."
rm -rf $FOCUS_ARCHIVE $FOCUS_APP
echo "Building archive..."
xcodebuild -workspace $BASE_DIR/Focus.xcworkspace -config Release -scheme Focus -archivePath $FOCUS_ARCHIVE archive
echo "Exporting archive..."
xcodebuild -archivePath $FOCUS_ARCHIVE -exportArchive -exportPath $FOCUS_APP -exportFormat app
echo "Cleaning up archive..."
rm -rf $FOCUS_ARCHIVE
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment