xcodebuild
概要
xcodebuild とは、Xcode プロジェクトおよび workspace のビルド、解析、テスト等の操作をコマンドライン上から実行できるコマンドラインツール。
xcodebuild is a command-line tool that allows you to perform build, query, analyze, test, and archive operations on your Xcode projects and workspaces from the command line.
https://developer.apple.com/library/archive/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-HOW_DO_I_BUILD_MY_PROJECTS_FROM_THE_COMMAND_LINE_
基本的な使い方は man ページを参照。
デフォルトでは、Xcode アプリケーションの Locations preferences ペインにて定義された場所に結果が出力される。
https://help.apple.com/xcode/mac/current/#/devd12cb6068
Xcode プロジェクトの設定やビルド等、様々な操作が行えるようだ。ただし、プロジェクトの root ディレクトリ直下でコマンドを実行する必要がある。
code:bash
# 例えば、ビルド設定を CLI から確認する、といったことができる
$ xcodebuild -showBuildSettings | grep <チェックしたい設定項目>
# Swift のバージョンの確認、とか
$ xcodebuild -showBuildSettings | grep SWIFT_VERSION