Skip to content

Instantly share code, notes, and snippets.

@wtsnz
Created June 7, 2013 02:51
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 wtsnz/5726768 to your computer and use it in GitHub Desktop.
Save wtsnz/5726768 to your computer and use it in GitHub Desktop.
Automatic iOS Deployments Bash Script
#!/bin/bash
cd /Shared\ Items/Public/AUTO/project
BUILDDIR="/Shared Items/Public/AUTO/project_build"
NAME="Project"
CONFIGURATION="Ad Hoc"
API_TOKEN="..."
TEAM_TOKEN="..."
# Reset Git
echo resetting
git reset --hard
echo pulling latest
git pull
xcodebuild -workspace $NAME.xcworkspace -scheme $NAME -configuration $CONFIGURATION clean build ONLY_ACTIVE_ARCH=NO CONFIGURATION_BUILD_DIR="$BUILDDIR"
echo $?
echo Generating .ipa file
xcrun -sdk iphoneos PackageApplication -v "$BUILDDIR/$NAME.app" -o "$BUILDDIR/$NAME.ipa"
echo $?
# Zip the dSYM File
echo Generating zip file
/usr/bin/zip -r "$BUILDDIR/$NAME.app.dSYM.zip" "$BUILDDIR/$NAME.app.dSYM"
echo $?
# Upload the build to TestFlight
echo Sending to TestFlight
/usr/bin/curl "http://testflightapp.com/api/builds.json " -F file=@"$BUILDDIR/$NAME.ipa" -F dsym=@"$BUILDDIR/$NAME.app.dSYM.zip" -F api_token="$API_TOKEN" -F team_token="$TEAM_TOKEN" -F notes="Build uploaded automatically from Xcode." -#
echo $?
echo Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment