Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.