$npx -y skills add bigdra50/unity-cli --skill unity-buildビルドワークフロー。検証 → 設定確認 → ビルド実行 → エラー対応。 Use for: "ビルド", "ビルド実行", "プラットフォーム設定", "ビルドエラー
| 1 | # unity-build |
| 2 | |
| 3 | > **PREREQUISITE:** `../unity-shared/SKILL.md`(Relay Server 経由で Unity Editor が起動/アクティブであること) |
| 4 | > |
| 5 | > skill 経由のコマンドは必ず `-i <instance>` を付ける (unity-shared #インスタンス指定)。 |
| 6 | |
| 7 | ## ワークフロー |
| 8 | |
| 9 | ```text |
| 10 | 1. /unity-verify Quick Verify コンパイルエラーがないことを確認 |
| 11 | 2. ビルド設定確認 u -i <instance> build settings --json |
| 12 | 3. ビルドシーン確認 u -i <instance> build scenes --json |
| 13 | 4. ビルド実行 u -i <instance> build run --target <platform> --output <path> |
| 14 | 5. 結果確認 成功/失敗を報告 |
| 15 | ``` |
| 16 | |
| 17 | ## コマンド |
| 18 | |
| 19 | ```bash |
| 20 | u -i <instance> build settings --json # 現在の設定 |
| 21 | u -i <instance> build scenes --json # ビルドシーン一覧 |
| 22 | u -i <instance> build run --target StandaloneWindows64 --output ./Build # ビルド実行 |
| 23 | ``` |
| 24 | |
| 25 | ## プラットフォーム |
| 26 | |
| 27 | | target | 値 | |
| 28 | |--------|---| |
| 29 | | Windows | `StandaloneWindows64` | |
| 30 | | macOS | `StandaloneOSX` | |
| 31 | | Android | `Android` | |
| 32 | | iOS | `iOS` | |
| 33 | | WebGL | `WebGL` | |
| 34 | |
| 35 | ## エラー対応 |
| 36 | |
| 37 | | エラー | 対応 | |
| 38 | |--------|------| |
| 39 | | コンパイルエラー | /unity-verify で修正ループ | |
| 40 | | Missing Scene | `u -i <instance> build scenes` で確認、シーンパス修正 | |
| 41 | | プラットフォーム未対応 | `u -i <instance> api call UnityEditor.EditorApplication ExecuteMenuItem --params '["File/Build Settings"]'` | |