Skip to content

Instantly share code, notes, and snippets.

@kuwabarahiroshi
Created October 22, 2013 09:13
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 kuwabarahiroshi/7097536 to your computer and use it in GitHub Desktop.
Save kuwabarahiroshi/7097536 to your computer and use it in GitHub Desktop.
iOSアプリのbuild -> TestFlightアップを自動化するMakefile
.PHONY: flight build
DATETIME = $(shell date '+%Y-%m-%d_%H%M%S')
PROVISIONNING_PROFILE = AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAAAA
BUILD = staging
default:
xcodebuild -sdk iphoneos -target appname -configuration Production -scheme appname-production build
update-bundle-version:
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion `git rev-list HEAD | wc -l`" appname/appname-Info.plist
adhoc:
make update-bundle-version
make $(BUILD)-build
make flight
production-build:
if [ -a build/production ]; then rm -R build/production ; fi;
mkdir -p build/production
xcodebuild \
-workspace appname.xcworkspace \
-sdk iphoneos \
-configuration Production \
-scheme appname-production \
clean build PROVISIONING_PROFILE=$(PROVISIONNING_PROFILE)
xcrun \
-sdk iphoneos PackageApplication \
-v $(shell xcodebuild -workspace appname.xcworkspace -scheme appname-production -showBuildSettings | grep TARGET_BUILD_DIR | tail -n 1 | cut -d '=' -f 2)/appname.app \
-o $(PWD)/build/production/appname.ipa \
--embed ~/Library/MobileDevice/Provisioning Profiles/$(PROVISIONNING_PROFILE).mobileprovision
echo production > build/.flight_target
staging-build:
if [ -a build/staging ]; then rm -R build/staging ; fi;
mkdir -p build/staging
xcodebuild \
-workspace appname.xcworkspace \
-sdk iphoneos \
-configuration Staging \
-scheme appname-staging \
clean build PROVISIONING_PROFILE=$(PROVISIONNING_PROFILE)
xcrun \
-sdk iphoneos PackageApplication \
-v $(shell xcodebuild -workspace appname.xcworkspace -scheme appname-staging -showBuildSettings | grep SYMROOT | tail -n 1 | cut -d '=' -f 2)/Staging-iphoneos/appname.app \
-o $(PWD)/build/staging/appname.ipa \
--embed ~/Library/MobileDevice/Provisioning Profiles/$(PROVISIONNING_PROFILE).mobileprovision
echo staging > build/.flight_target
flight:
git log last-flight.. --pretty=format:'%h %ad %an%n%s%n' -s > build/.commits_since_last_flight
curl http://testflightapp.com/api/builds.json \
-F file=@build/`cat build/.flight_target`/appname.ipa \
-F api_token=api_token_aaldkfalskdf \
-F team_token=team_token_alkdfja \
-F notes=@build/.commits_since_last_flight \
-F notify=True \
-F distribution_lists='TeamName'
git tag -f last-flight
git push --tags -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment