feat(simctl): Add clone, create, and delete simulator management commands#418
feat(simctl): Add clone, create, and delete simulator management commands#418yjmeqt wants to merge 4 commits into
Conversation
…ands Wraps xcrun simctl clone, create, and delete as MCP/CLI tools, registered under the simulator-management workflow. Co-Authored-By: deepseek v4 pro <noreply@anthropic.com>
Use NonStreamingExecutor pattern with SimulatorActionResultDomainResult, add action types to domain-results and renderer labels. Co-Authored-By: deepseek v4 pro <noreply@anthropic.com>
Co-Authored-By: deepseek v4 pro <noreply@anthropic.com>
commit: |
| const command = ['xcrun', 'simctl', 'clone', params.sourceSimulatorId]; | ||
| if (params.newName) { | ||
| command.push(params.newName); | ||
| } |
There was a problem hiding this comment.
Bug: The clone_sims tool incorrectly treats the newName parameter as optional, causing the underlying simctl clone command to fail if it's not provided.
Severity: HIGH
Suggested Fix
Make the newName parameter required in the Zod schema for the clone_sims tool. This ensures that the simctl clone command is always constructed with the required name argument, preventing runtime errors.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: src/mcp/tools/simulator-management/clone_sims.ts#L79-L82
Potential issue: The `clone_sims` tool defines the `newName` parameter as optional and
constructs the `simctl` command to only include the name if provided. However, the
underlying `xcrun simctl clone` command requires a name as a positional argument. If the
tool is called without `newName`, the executed command `xcrun simctl clone <device>` is
incomplete, which will cause `simctl` to exit with a "Missing argument" error.
- Fix publicSchemaObject to not omit non-session-default params - Capture new simulator UDID from simctl clone/create stdout - Allow shutdownFirst for delete_sims with target=all - Add tests for clone, create, and delete tools Co-Authored-By: deepseek v4 pro <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 140c26f. Configure here.
| action: { | ||
| type: 'clone', | ||
| sourceSimulatorId: params.sourceSimulatorId, | ||
| }, |
There was a problem hiding this comment.
Output schema missing new action types
Medium Severity
The JSON schema for simulator-action-result (1.schema.json) was not updated to include the new clone, create, and delete action types. The action property's oneOf constraint only lists old types (boot, erase, open, etc.), so structured output from all three new tools will fail JSON schema validation. Tool manifests, schemas, and implementations need to stay aligned when tools are added.
Additional Locations (1)
Triggered by project rule: Bugbot Review Guide for XcodeBuildMCP
Reviewed by Cursor Bugbot for commit 140c26f. Configure here.


Summary
clone_sims(xcrun simctl clone) — clone an existing simulatorcreate_sim(xcrun simctl create) — create a new simulatordelete_sims(xcrun simctl delete) — delete by UDID, all, or unavailable simulators (withshutdownFirstoption)simulator-managementworkflowCloses #414
Test plan
npm run buildsucceeds