Last active
December 25, 2015 04:09
-
-
Save STAR-ZERO/6915250 to your computer and use it in GitHub Desktop.
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/sh | |
# TestFlight upload notes | |
while getopts "m:" opts | |
do | |
case $opts in | |
m) | |
NOTES=$OPTARG ;; | |
esac | |
done | |
# Application Name | |
APP="<アプリ名>" | |
# SDK | |
SDK="iphoneos7.0" | |
# Build Configurations | |
CONFIGURATION="AdHoc" | |
# Output directory | |
OUT_DIR="build" | |
# Workspace name(xxxxxx.xcworkspace) | |
WORKSPACE="<ワークスペース名>" | |
# Scheme | |
SCHEME="<Scheme名>" | |
# PROVISIONING PROFILE | |
PROVISIONING="Provisionin profileのUUID" | |
# TestFlight API token | |
TESTFLIGHT_API_TOKEN="<TestFlight APIトークン>" | |
# TestFlight Team token | |
TESTFLIGHT_TEAM_TOKEN="<TestFlight Teamトークン>" | |
# TestFlight distribution lists | |
DISTRIBUTION_LISTS="<配布先チーム名>" | |
# Remove output directory | |
if [ -d ${OUT_DIR} ]; then | |
rm -R "${OUT_DIR}" | |
fi | |
# Clean | |
xcodebuild -alltargets clean | |
# Build | |
xcodebuild -workspace "${WORKSPACE}" -sdk "${SDK}" -configuration "${CONFIGURATION}" -scheme "${SCHEME}" CONFIGURATION_BUILD_DIR="$(PWD)/${OUT_DIR}" PROVISIONING_PROFILE="${PROVISIONING}" archive -archivePath "build/${APP}" | |
# IPA | |
xcrun -sdk "${SDK}" PackageApplication "${OUT_DIR}/${APP}.xcarchive/Products/Applications/${APP}.app" -o "$(PWD)/${OUT_DIR}/${APP}.ipa" --embed "${PROVISIONING}.mobileprovision" | |
# dSYM | |
zip -r $(PWD)/${OUT_DIR}/${APP}.app.dSYM.zip $(PWD)/${OUT_DIR}/${APP}.app.dSYM | |
curl http://testflightapp.com/api/builds.json \ | |
-F file="@${OUT_DIR}/${APP}.ipa" \ | |
-F dsym="@${OUT_DIR}/${APP}.app.dSYM.zip" \ | |
-F api_token="${TESTFLIGHT_API_TOKEN}" \ | |
-F team_token="${TESTFLIGHT_TEAM_TOKEN}" \ | |
-F notify=True \ | |
-F notes="${NOTES:-$(date)}" \ | |
-F distribution_lists="${DISTRIBUTION_LISTS}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment