12
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

xcodebuildでコマンドラインからUT実行

Posted at

Xcodeを起動しなくてもUTを実行したい。そんな場合向けのMakefile

$BUILDACTIONS, $DEST は適宜環境に合わせて。

xcpretty は gem install xcpretty とかでインストールしておく。

Makefile
XCODEBUILD = xcodebuild
DEST = 'platform=iOS Simulator,name=iPhone Retina (4-inch)'
WORKSPACE = APE.xcodeproj/project.xcworkspace
PROJECT = Project.xcodeproj
SCHEME = SchemeName
DEBUG = Debug
RELEASE = Release
BUILDACTIONS = clean test
PIPECMD = | xcpretty -c

all: test_release

test_release:
	$(XCODEBUILD) -scheme $(SCHEME) -destination $(DEST) -configuration $(RELEASE) $(BUILDACTIONS) $(PIPECMD)

test_debug:
	$(XCODEBUILD) -scheme $(SCHEME) -destination $(DEST) -configuration $(DEBUG) $(BUILDACTIONS) $(PIPECMD)

xcpretty のおかげで成功、失敗したテストが見やすくて便利。

12
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?