Skip to content

Instantly share code, notes, and snippets.

@ochi0218
Last active August 29, 2015 14:02
Show Gist options
  • Save ochi0218/78c4eb0c438b9f2ff8be to your computer and use it in GitHub Desktop.
Save ochi0218/78c4eb0c438b9f2ff8be to your computer and use it in GitHub Desktop.
testflightにアップロードするためのMakefile
PHONY: all build archive testflight clean
PROJECT ?= 【プロジェクト名】.xcworkspace
SCHEME ?= 【スキーマ】
SDK ?= iphoneos7.0
CONFIGURATION ?= Release
SIGN ?= iOS Developer
TESTFLIGHT_API_TOKEN ?= testFightのAPIトークン
TESTFLIGHT_TEAM_TOKEN ?= testFightのチームトークン
TESTFLIGHT_NOTIFTY = True
all: archive
out:
mkdir -p dist
build: out
xcodebuild -workspace '$(PROJECT)' -scheme '$(SCHEME)' -configuration $(CONFIGURATION) -sdk $(SDK) install DSTROOT=dist CONFIGURATION_BUILD_DIR=$(PWD)/dist/build
archive: build
xcrun -sdk $(SDK) PackageApplication 'dist/Applications/$(SCHEME).app' -o $(PWD)/dist/$(SCHEME).ipa
testflight: archive
curl 'http://testflightapp.com/api/builds.json' \
-F 'file=@$(PWD)/dist/$(SCHEME).ipa' \
-F 'api_token=$(TESTFLIGHT_API_TOKEN)' \
-F 'team_token=$(TESTFLIGHT_TEAM_TOKEN)' \
-F 'notes=new version from api' \
-F 'notify=$(TESTFLIGHT_NOTIFTY)'
clean:
rm -rf $(PWD)/dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment