23

ワークスペースとスキームを指定すると、xcodebuild コマンド ライン ツールがどうなるか少し混乱しています。

構成されたスキームが XCode IDE GUI でどのように機能するかを理解しています。ビルド アクションは、ビルドするターゲットを一覧表示し、各アクション (分析、テスト、実行、プロファイル、アーカイブ) に対して、ビルド アクションを実行するターゲットを選択します。

したがって、ビルドのビルド アクションで各アクション (分析、テスト、実行、プロファイル、アーカイブ) を選択した場合、以下のコマンドを実行するとどうなりますか。

xcodebuild clean install -workspace MyWorkspace.xcworkspace -scheme MyScheme 
-configuration AdHoc SYMROOT=PATH DSTROOT=PATH...

XCodeでスキームを編集するときに指定されたすべての構成を持つメインのxcodeprojでMyScheme.xcschemeを検索します。

xcodebuild はこのファイルから何を読み込みますか? アドホック構成で構成されたターゲットをビルドするだけで、他のすべてを無視しますか?

4

1 に答える 1

18

あなたはほとんどそこにいますが、あなたの構文は少しずれています. マニュアルページによると:

xcodebuild -workspace ワークスペース名 -scheme スキーム名 [-configuration 構成名] [-sdk [sdkfullpath | sdkname]] [buildaction ...] [setting=value ...] [-userdefault=value ...]

buildaction は次のいずれかです。

buildaction ... ターゲットで実行するビルド アクション (複数可) を指定します。利用可能なビルド アクションは次のとおりです。

       build       Build the target in the build root (SYMROOT).  This is the default build action.

       archive     Archive a scheme from the build root (SYMROOT).  This requires specifying a scheme.

       test        Test a scheme from the build root (SYMROOT).  This requires specifying a scheme.

       installsrc  Copy the source of the project to the source root (SRCROOT).

       install     Build the target and install it into the target's installation directory in the dis-
                   tribution root (DSTROOT).

       clean       Remove build products and intermediate files from the build root (SYMROOT).

Xcode IDE では、[製品] メニューから実行する buildaction を選択するか、IDE の左上にある丸いボタンをクリックして押したままにします (実行 = 三角形の再生、テスト = レンチ アイコンなど)。

また、xcodebuild がビルド スキームを探す場所に注意してください。作成したファイルに応じて、.xcproj ファイルまたは .xcworkspace ファイルのいずれかになります。(ワークスペースを手動で作成しなかった場合は、.xcproj ファイルが作成されます)。

また、Xcode の [スキームの管理] 設定を使用して、所有しているスキームを確認することもできます。

于 2013-08-22T19:59:17.603 に答える