Created
February 20, 2014 08:22
-
-
Save MaximumP/9109071 to your computer and use it in GitHub Desktop.
Make iOS IPA and Upload to Testflight
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# testflightapp.com tokens | |
API_TOKEN="790a7290435d7a8284f97c65d410bcc7_MTU1NjQ5NzIwMTQtMDEtMDkgMDc6NTI6MzEuNzEyMjI3" | |
TEAM_TOKEN="2657e25c03d201fbdc07b427c93fe6d0_MjYzMTYwMjAxMy0wOC0yMiAxOToxNDoxOS41NzU1OTM" | |
PRODUCT_NAME="iKout" | |
ARTEFACTS="$PWD/Artefacts" | |
SIGNING_IDENTITY="iPhone Distribution: Diwaniya Labs Inc. (NDCUMGF5FY)" | |
PROVISIONING_PROFILE="${HOME}/Desktop/id/iKout_AdHoc.mobileprovision" | |
# calculated vars | |
OUT_IPA="${ARTEFACTS}/${PRODUCT_NAME}.ipa" | |
OUT_DSYM="${ARTEFACTS}/${PRODUCT_NAME}.dSYM.zip" | |
# kill artefacts directory | |
rm -rf $ARTEFACTS | |
mkdir $ARTEFACTS | |
#ipa | |
echo "##teamcity[progressMessage 'Creating .ipa for ${PRODUCT_NAME}']" | |
DATE=$( /bin/date +"%%Y-%%m-%%d" ) | |
ARCHIVE=$( /bin/ls -t "${HOME}/Library/Developer/Xcode/Archives/${DATE}" | /usr/bin/grep xcarchive | /usr/bin/sed -n 1p ) | |
DSYM="${HOME}/Library/Developer/Xcode/Archives/${DATE}/${ARCHIVE}/dSYMs/${PRODUCT_NAME}.app.dSYM" | |
APP="${HOME}/Library/Developer/Xcode/Archives/${DATE}/${ARCHIVE}/Products/Applications/${PRODUCT_NAME}.app" | |
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${APP}" -o "${OUT_IPA}" --sign "${SIGNING_IDENTITY}" --embed "${PROVISIONING_PROFILE}" | |
#symbols | |
echo "##teamcity[progressMessage 'Zipping .dSYM for ${PRODUCT_NAME}']" | |
/usr/bin/zip -r "${OUT_DSYM}" "${DSYM}" | |
# prepare build notes | |
NOTES="Uploaded Automatically by our awesome CI Server (to include notes from cm in the future)" | |
#upload | |
echo "##teamcity[progressMessage 'Uploading ${PRODUCT_NAME} to TestFlight']" | |
/usr/bin/curl "http://testflightapp.com/api/builds.json" \ | |
-F file=@"${OUT_IPA}" \ | |
-F dsym=@"${OUT_DSYM}" \ | |
-F api_token="${API_TOKEN}" \ | |
-F team_token="${TEAM_TOKEN}" \ | |
-F notes="${NOTES}" \ | |
-F notify="True" \ | |
-F distribution_lists="Private" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment