Created
September 30, 2011 15:42
-
-
Save reklis/1254152 to your computer and use it in GitHub Desktop.
Archive post-action
This file contains hidden or 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
#in older versions of Xcode4 you may need to set PRODUCT_NAME manually | |
DIST_LIST=<TestFlight Distribution List name here> | |
API_TOKEN=<TestFlight API token here> | |
TEAM_TOKEN=<TestFlight team token here> | |
SIGNING_IDENTITY="iPhone Distribution: Development Seed" | |
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/MapBox Ad Hoc.mobileprovision" | |
LOG="/tmp/testflight.log" | |
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 ) | |
APP="${HOME}/Library/Developer/Xcode/Archives/${DATE}/${ARCHIVE}/Products/Applications/${PRODUCT_NAME}.app" | |
NOTES=$(osascript ${HOME}/.utility_scripts/prompt.scpt 'Xcode' 'Enter TestFlight build Notes') | |
/usr/bin/open -a /Applications/Utilities/Console.app $LOG | |
echo -n "Creating .ipa for ${PRODUCT_NAME}... " > $LOG | |
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${APP}" -o "/tmp/${PRODUCT_NAME}.ipa" --sign "${SIGNING_IDENTITY}" --embed "${PROVISIONING_PROFILE}" | |
echo "done." >> $LOG | |
echo -n "Uploading to TestFlight... " >> $LOG | |
/usr/bin/curl "http://testflightapp.com/api/builds.json" \ | |
-F file=@"/tmp/${PRODUCT_NAME}.ipa" \ | |
-F api_token="${API_TOKEN}" \ | |
-F team_token="${TEAM_TOKEN}" \ | |
-F notes="${NOTES}" \ | |
-F notify=True -F distribution_lists="${DIST_LIST}" >> $LOG | |
echo "done." >> $LOG | |
/usr/bin/open "https://testflightapp.com/dashboard/builds/" |
This file contains hidden or 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
on run argv | |
tell application (item 1 of argv) | |
set input to display dialog "" & item 2 of argv & ":" default answer "" | |
if button returned of input is equal to "OK" then | |
try | |
return (text returned of input) | |
end try | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
original article:
http://developmentseed.org/blog/2011/sep/02/automating-development-uploads-testflight-xcode/
This is updated to prompt for notes and log the CURL result