Jenkins を使用して CI システムをセットアップしていますが、次の行を実行したときに xcodebuild がスキームがないと報告するため、ビルドが失敗していることに気付きました。
-xcodebuild -workspace XXX -scheme NNN.
なぜこれが起こっているのかわからなかったので、ワークスペースで何か厄介なことを排除するために、XCodeを使用して新しいプロジェクトテンプレートを作成しました.xcodebuildコマンドとワークスペース/プロジェクトの動作に違いがあることがわかりました. .
テンプレート プロジェクトはスクラップと呼ばれ、端末のコマンド ラインから次のコマンドを実行した場合、たとえば次のようになります。
xcodebuild -list
出力します
Information about project "scrap":
Targets:
scrap
Build Configurations:
Debug
Release
If no build configuration is specified and -scheme is not passed then "Release" is used.
Schemes:
scrap
しかし、Jenkins 内から xcodebuild -list を実行すると、出力は次のようになります。
Building in workspace /Users/Shared/Jenkins/Home/workspace/scrap
[scrap] $ /bin/sh -xe /var/folders/ph/s6dvlfq9769741g_yzmjlmz000007c/T/hudson3765407964219991487.sh
+ xcodebuild -list
Information about project "scrap":
Targets:
scrap
Build Configurations:
Debug
Release
If no build configuration is specified and -scheme is not passed then "Release" is used.
This project contains no schemes.
これは最も単純な jenkins ジョブです。新しいジョブを作成し、それをフリー スタイルのソフトウェア プロジェクトに設定してから、Execut シェルのビルド ステップを追加し、xcodebuild -list コマンドを追加するだけです。
スキームがあるのに、xcodebuild がスキームがないと言っているのはなぜですか? また、Jenkins 内から実行すると動作が異なるのはなぜですか?