Skip to content

feat(simctl): Add clone, create, and delete simulator management commands#418

Open
yjmeqt wants to merge 4 commits into
getsentry:mainfrom
yjmeqt:feat/simctl-clone-create-delete
Open

feat(simctl): Add clone, create, and delete simulator management commands#418
yjmeqt wants to merge 4 commits into
getsentry:mainfrom
yjmeqt:feat/simctl-clone-create-delete

Conversation

@yjmeqt
Copy link
Copy Markdown

@yjmeqt yjmeqt commented May 14, 2026

Summary

  • Adds clone_sims (xcrun simctl clone) — clone an existing simulator
  • Adds create_sim (xcrun simctl create) — create a new simulator
  • Adds delete_sims (xcrun simctl delete) — delete by UDID, all, or unavailable simulators (with shutdownFirst option)
  • All three tools registered under the simulator-management workflow

Closes #414

Test plan

  • Type check passes (no new errors)
  • npm run build succeeds
  • CLI help output verified for all three commands
  • Existing tests pass (no regressions)

…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>
Comment thread src/mcp/tools/simulator-management/clone_sims.ts Outdated
Comment thread src/mcp/tools/simulator-management/delete_sims.ts
Comment thread src/mcp/tools/simulator-management/clone_sims.ts Outdated
meqtMac and others added 2 commits May 14, 2026 23:28
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>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 14, 2026

Open in StackBlitz

npm i https://pkg.pr.new/xcodebuildmcp@418

commit: 140c26f

Comment thread src/mcp/tools/simulator-management/clone_sims.ts
Comment thread src/mcp/tools/simulator-management/delete_sims.ts Outdated
Comment on lines +79 to +82
const command = ['xcrun', 'simctl', 'clone', params.sourceSimulatorId];
if (params.newName) {
command.push(params.newName);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/mcp/tools/simulator-management/create_sim.ts Outdated
Comment thread src/mcp/tools/simulator-management/create_sim.ts Outdated
Comment thread src/mcp/tools/simulator-management/clone_sims.ts
- 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>
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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,
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Triggered by project rule: Bugbot Review Guide for XcodeBuildMCP

Reviewed by Cursor Bugbot for commit 140c26f. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clone simulators

2 participants