open_simulator
Launch the iOS Simulator application to test and debug mobile apps in a virtual environment.
Instructions
Opens the iOS Simulator application
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:191-223 (registration)Registration of the 'open_simulator' tool using server.tool(), conditional on not being filtered. Includes the inline handler function.if (!isToolFiltered("open_simulator")) { server.tool( "open_simulator", "Opens the iOS Simulator application", async () => { try { await run("open", ["-a", "Simulator.app"]); return { isError: false, content: [ { type: "text", text: "Simulator.app opened successfully", }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: errorWithTroubleshooting( `Error opening Simulator.app: ${toError(error).message}` ), }, ], }; } } ); }
- src/index.ts:195-221 (handler)The handler function for 'open_simulator' that executes 'open -a Simulator.app' via the run helper and returns a success or error response.async () => { try { await run("open", ["-a", "Simulator.app"]); return { isError: false, content: [ { type: "text", text: "Simulator.app opened successfully", }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: errorWithTroubleshooting( `Error opening Simulator.app: ${toError(error).message}` ), }, ], }; } }
- src/index.ts:30-39 (helper)Helper function 'run' used by the open_simulator handler to execute shell commands.async function run( cmd: string, args: string[] ): Promise<{ stdout: string; stderr: string }> { const { stdout, stderr } = await execFileAsync(cmd, args, { shell: false }); return { stdout: stdout.trim(), stderr: stderr.trim(), }; }
- src/index.ts:85-87 (helper)Helper function to check if a tool is filtered out via environment variable.function isToolFiltered(toolName: string): boolean { return FILTERED_TOOLS.includes(toolName); }