Skip to content

Commit c8cdd4d

Browse files
cameroncookeclaude
andcommitted
fix(simulator): Prefer build_run_sim for run intent
Align agent guidance and simulator discovery hints so run or launch intent\ndefaults to build_run_sim while keeping build_sim as compile-only.\n\nThis avoids the common redundant sequence of running build_sim and then\nbuild_run_sim, which double-builds without adding value. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent cee7039 commit c8cdd4d

File tree

8 files changed

+59
-18
lines changed

8 files changed

+59
-18
lines changed

docs/TOOLS-CLI.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ XcodeBuildMCP provides 73 canonical tools organized into 13 workflow groups.
3737
**Purpose**: Complete iOS development workflow for both .xcodeproj and .xcworkspace files targeting simulators. (21 tools)
3838

3939
- `boot` - Defined in Simulator Management workflow.
40-
- `build` - Build for iOS sim.
41-
- `build-and-run` - Build and run iOS sim.
40+
- `build` - Build for iOS sim (compile-only, no launch).
41+
- `build-and-run` - Build and run iOS sim (preferred for run/launch intent).
4242
- `clean` - Defined in iOS Device Development workflow.
4343
- `discover-projects` - Defined in iOS Device Development workflow.
4444
- `get-app-bundle-id` - Defined in iOS Device Development workflow.
@@ -189,4 +189,4 @@ XcodeBuildMCP provides 73 canonical tools organized into 13 workflow groups.
189189

190190
---
191191

192-
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-16T21:51:58.527Z UTC*
192+
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-16T21:53:02.251Z UTC*

docs/TOOLS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
3535
**Purpose**: Complete iOS development workflow for both .xcodeproj and .xcworkspace files targeting simulators. (21 tools)
3636

3737
- `boot_sim` - Defined in Simulator Management workflow.
38-
- `build_run_sim` - Build and run iOS sim.
39-
- `build_sim` - Build for iOS sim.
38+
- `build_run_sim` - Build and run iOS sim (preferred for run/launch intent).
39+
- `build_sim` - Build for iOS sim (compile-only, no launch).
4040
- `clean` - Defined in iOS Device Development workflow.
4141
- `discover_projs` - Defined in iOS Device Development workflow.
4242
- `get_app_bundle_id` - Defined in iOS Device Development workflow.
@@ -204,4 +204,4 @@ This document lists MCP tool names as exposed to MCP clients. XcodeBuildMCP prov
204204

205205
---
206206

207-
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-16T21:51:58.527Z UTC*
207+
*This documentation is automatically generated by `scripts/update-tools-docs.ts` from the tools manifest. Last updated: 2026-02-16T21:53:02.251Z UTC*

manifests/tools/build_run_sim.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module: mcp/tools/simulator/build_run_sim
33
names:
44
mcp: build_run_sim
55
cli: build-and-run
6-
description: Build and run iOS sim.
6+
description: Build and run iOS sim (preferred for run/launch intent).
77
predicates:
88
- hideWhenXcodeAgentMode
99
annotations:

manifests/tools/build_sim.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module: mcp/tools/simulator/build_sim
33
names:
44
mcp: build_sim
55
cli: build
6-
description: Build for iOS sim.
6+
description: Build for iOS sim (compile-only, no launch).
77
predicates:
88
- hideWhenXcodeAgentMode
99
annotations:

skills/xcodebuildmcp-cli/SKILL.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ Notes:
3333

3434
### Build And Run On Simulator
3535

36+
If your intent is to run the app in Simulator, use `build-and-run` directly. It already performs the build step.
37+
Do not run `build` first unless the user explicitly requests both commands.
38+
3639
1. List simulators and pick a device name or UDID.
3740
2. Build and run.
3841

@@ -50,7 +53,8 @@ xcodebuildmcp simulator build-and-run --scheme MyApp --project-path ./MyApp.xcod
5053

5154
### Build only
5255

53-
When you only need to check that there are no build errors, you can build without running the app.
56+
Use this only when you want compile feedback and do not want to launch the app.
57+
For run/launch intent, use `build-and-run` instead of chaining `build` and `build-and-run`.
5458

5559
```bash
5660
xcodebuildmcp simulator build --scheme MyApp --project-path ./MyApp.xcodeproj --simulator-name "iPhone 17 Pro"

skills/xcodebuildmcp/SKILL.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ Prefer XcodeBuildMCP over raw `xcodebuild`, `xcrun`, or `simctl`.
99

1010
If a capability is missing, assume your tool list may be hiding tools (search/progressive disclosure) or not loading tool schemas yet. Use your tool-search or “load tools” mechanism. If you still can’t find the tools, ask the user to enable them in the MCP client's configuration.
1111

12+
## Default Tool Choice (Simulator)
13+
14+
- If intent includes run/launch/open in Simulator, use `build_run_sim` as the default.
15+
- If intent is compile-only feedback (no launch), use `build_sim`.
16+
- Do not call `build_sim` and then `build_run_sim` in sequence unless the user explicitly asks for both.
17+
- If the app is already built and you need launch only without rebuilding, use `install_app_sim` + `launch_app_sim` (or `launch_app_logs_sim`).
18+
1219
## Tools (exact names + official descriptions)
1320

1421
### Session defaults

src/mcp/tools/project-discovery/__tests__/list_schemes.test.ts

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,30 @@ describe('list_schemes plugin', () => {
7979
priority: 1,
8080
},
8181
{
82-
tool: 'build_sim',
83-
label: 'Build for iOS Simulator',
82+
tool: 'build_run_sim',
83+
label: 'Build and run on iOS Simulator (default for run intent)',
8484
params: {
8585
projectPath: '/path/to/MyProject.xcodeproj',
8686
scheme: 'MyProject',
8787
simulatorName: 'iPhone 16',
8888
},
8989
priority: 2,
9090
},
91+
{
92+
tool: 'build_sim',
93+
label: 'Build for iOS Simulator (compile-only)',
94+
params: {
95+
projectPath: '/path/to/MyProject.xcodeproj',
96+
scheme: 'MyProject',
97+
simulatorName: 'iPhone 16',
98+
},
99+
priority: 3,
100+
},
91101
{
92102
tool: 'show_build_settings',
93103
label: 'Show build settings',
94104
params: { projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyProject' },
95-
priority: 3,
105+
priority: 4,
96106
},
97107
],
98108
isError: false,
@@ -317,20 +327,30 @@ describe('list_schemes plugin', () => {
317327
priority: 1,
318328
},
319329
{
320-
tool: 'build_sim',
321-
label: 'Build for iOS Simulator',
330+
tool: 'build_run_sim',
331+
label: 'Build and run on iOS Simulator (default for run intent)',
322332
params: {
323333
workspacePath: '/path/to/MyProject.xcworkspace',
324334
scheme: 'MyApp',
325335
simulatorName: 'iPhone 16',
326336
},
327337
priority: 2,
328338
},
339+
{
340+
tool: 'build_sim',
341+
label: 'Build for iOS Simulator (compile-only)',
342+
params: {
343+
workspacePath: '/path/to/MyProject.xcworkspace',
344+
scheme: 'MyApp',
345+
simulatorName: 'iPhone 16',
346+
},
347+
priority: 3,
348+
},
329349
{
330350
tool: 'show_build_settings',
331351
label: 'Show build settings',
332352
params: { workspacePath: '/path/to/MyProject.xcworkspace', scheme: 'MyApp' },
333-
priority: 3,
353+
priority: 4,
334354
},
335355
],
336356
isError: false,

src/mcp/tools/project-discovery/list_schemes.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,30 @@ export async function listSchemesLogic(
9999
priority: 1,
100100
},
101101
{
102-
tool: 'build_sim',
103-
label: 'Build for iOS Simulator',
102+
tool: 'build_run_sim',
103+
label: 'Build and run on iOS Simulator (default for run intent)',
104104
params: {
105105
[`${projectOrWorkspace}Path`]: path!,
106106
scheme: firstScheme,
107107
simulatorName: 'iPhone 16',
108108
},
109109
priority: 2,
110110
},
111+
{
112+
tool: 'build_sim',
113+
label: 'Build for iOS Simulator (compile-only)',
114+
params: {
115+
[`${projectOrWorkspace}Path`]: path!,
116+
scheme: firstScheme,
117+
simulatorName: 'iPhone 16',
118+
},
119+
priority: 3,
120+
},
111121
{
112122
tool: 'show_build_settings',
113123
label: 'Show build settings',
114124
params: { [`${projectOrWorkspace}Path`]: path!, scheme: firstScheme },
115-
priority: 3,
125+
priority: 4,
116126
},
117127
);
118128

0 commit comments

Comments
 (0)