Skip to content

Instantly share code, notes, and snippets.

@alexruperez
Last active August 31, 2020 13:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexruperez/4648965 to your computer and use it in GitHub Desktop.
Save alexruperez/4648965 to your computer and use it in GitHub Desktop.
A shell script that upload your .ipa file as a build in TestFlight. You just have to set the script variables, place your '<YOUR_PRODUCT_NAME>.ipa' file in the same folder as the script and run it with './testflight.sh'.
#!/bin/bash
PRODUCT_NAME=<YOUR_PRODUCT_NAME>
API_TOKEN=<YOUR_TESTFLIGHT_API_TOKEN>
TEAM_TOKEN=<YOUR_TESTFLIGHT_TEAM_TOKEN>
NOTIFY="True"
NOTES="Build uploaded via the upload API"
if [ "$1" ]
then
NOTES="$1"
fi
if [ ! -f "${PRODUCT_NAME}.ipa" ]
then
echo "${PRODUCT_NAME}.ipa not found!"
else
echo "Uploading to TestFlight..."
/usr/bin/curl "http://testflightapp.com/api/builds.json" \
-F file=@"${PRODUCT_NAME}.ipa" \
-F api_token="${API_TOKEN}" \
-F team_token="${TEAM_TOKEN}" \
-F notify="${NOTIFY}" \
-F replace="True" \
-F notes="${NOTES}"
/usr/bin/open "https://testflightapp.com/dashboard/builds/"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment