open_sim
Launch the iOS Simulator directly from the XcodeBuildMCP server for testing and development purposes.
Instructions
Opens the iOS Simulator app.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- The core handler function `open_simLogic` that implements the tool logic by executing the macOS shell command `open -a Simulator` to launch the iOS Simulator app. It handles success with helpful next steps and errors gracefully.export async function open_simLogic( params: OpenSimParams, executor: CommandExecutor, ): Promise<ToolResponse> { log('info', 'Starting open simulator request'); try { const command = ['open', '-a', 'Simulator']; const result = await executor(command, 'Open Simulator', true); if (!result.success) { return { content: [ { type: 'text', text: `Open simulator operation failed: ${result.error}`, }, ], }; } return { content: [ { type: 'text', text: `Simulator app opened successfully`, }, { type: 'text', text: `Next Steps: 1. Boot a simulator if needed: boot_sim({ simulatorId: 'UUID_FROM_LIST_SIMULATORS' }) 2. Launch your app and interact with it 3. Log capture options: - Option 1: Capture structured logs only (app continues running): start_sim_log_cap({ simulatorId: 'UUID', bundleId: 'YOUR_APP_BUNDLE_ID' }) - Option 2: Capture both console and structured logs (app will restart): start_sim_log_cap({ simulatorId: 'UUID', bundleId: 'YOUR_APP_BUNDLE_ID', captureConsole: true }) - Option 3: Launch app with logs in one step: launch_app_logs_sim({ simulatorId: 'UUID', bundleId: 'YOUR_APP_BUNDLE_ID' })`, }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); log('error', `Error during open simulator operation: ${errorMessage}`); return { content: [ { type: 'text', text: `Open simulator operation failed: ${errorMessage}`, }, ], }; } }
- Zod schema for the `open_sim` tool parameters. No parameters are required (empty object).const openSimSchema = z.object({});
- src/mcp/tools/simulator/open_sim.ts:70-75 (registration)Default export registering the `open_sim` tool with name, description, schema, and wrapped handler for MCP compatibility.export default { name: 'open_sim', description: 'Opens the iOS Simulator app.', schema: openSimSchema.shape, // MCP SDK compatibility handler: createTypedTool(openSimSchema, open_simLogic, getDefaultCommandExecutor), };
- src/mcp/tools/simulator-management/open_sim.ts:2-2 (registration)Re-export of the `open_sim` tool default export for use in the simulator-management module.export { default } from '../simulator/open_sim.ts';