22
23

More than 5 years have passed since last update.

コマンドラインからiOSアプリをビルドするMakefileテンプレ

Last updated at Posted at 2014-09-24

xcodeを一切起動することなく、
コマンドラインからのみビルドできます。
もちろん、xcodeを起動していも整合性は維持しており
case by case でどちからでもビルドできます。

-

PROJECT = @ここにプロジェクト名@.xcodeproj
SCHEME = @ここにスキーム名@

# RELEASE or DEBUG を選択します
BUILD_CONFIG = $(RELEASE)


DEST = 'platform=iOS Simulator,name=iPhone Retina (4-inch)'
XC = xcodebuild -scheme $(SCHEME) -destination $(DEST) -configuration 
DEBUG = Debug
RELEASE = Release

# -----------------------------------------------------
# BUILD_CONFIG 設定次第のビルド
all: 
    $(XC) $(BUILD_CONFIG)

# BUILD_CONFIG 設定次第のクリーン
clean:
    $(XC) $(BUILD_CONFIG) clean

# -----------------------------------------------------
# 明示的なリリースビルド
release:
    $(XC) $(RELEASE)

# 明示的なリリースクリーン
clean_release:
    $(XC) $(RELEASE) clean

# -----------------------------------------------------
# 明示的なデバッグビルド
debug:
    $(XC) $(DEBUG)

# 明示的なデバッグクリーン
clean_debug:
    $(XC) $(DEBUG) clean

make run でシミュレータの起動もTryするものの、
なかなかいい方法が見つかりませんでした。
ご存知な方はお知らせください。

22
23
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
22
23