simulator.boot
Start an iOS simulator device for testing React Native/Expo applications. This tool launches the configured simulator to enable development workflows.
Instructions
Boot an iOS simulator device
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | No | Device name or UDID. Defaults to config defaultDeviceName. |
Implementation Reference
- src/simulator/devices.ts:101-136 (handler)Core handler function that boots the specified iOS simulator device using simctl boot command, handles already booted state, updates global state managerexport async function bootDevice(nameOrUdid: string): Promise<SimulatorDevice> { logger.info("simulator", `Booting simulator: ${nameOrUdid}`); const device = await findDevice(nameOrUdid); if (!device) { throw createError("SIM_NOT_FOUND", `Simulator not found: ${nameOrUdid}`, { details: "Use simulator.list_devices to see available simulators", }); } if (device.state === "Booted") { logger.info("simulator", `Device ${device.name} is already booted`); stateManager.updateSimulator({ state: "booted", udid: device.udid, deviceName: device.name, }); return device; } stateManager.updateSimulator({ state: "booting", udid: device.udid, deviceName: device.name }); const result = await simctl(["boot", device.udid], { timeoutMs: 120000 }); if (result.exitCode !== 0) { stateManager.updateSimulator({ state: "unknown" }); const { code, message } = parseSimctlError(result.stderr); throw createError(code, message, { details: result.stderr }); } stateManager.updateSimulator({ state: "booted" }); logger.info("simulator", `Device ${device.name} booted successfully`); return { ...device, state: "Booted" }; }
- src/mcp/schemas.ts:16-18 (schema)Zod input schema defining optional 'device' parameter for simulator.boot toolexport const SimulatorBootInputSchema = z.object({ device: z.string().optional().describe("Device name or UDID. Defaults to config defaultDeviceName."), });
- src/mcp/server.ts:88-112 (registration)MCP server registration of 'simulator.boot' tool, including input schema reference and thin async handler wrapper that delegates to bootDevice and formats MCP responseserver.tool( "simulator.boot", "Boot an iOS simulator device", SimulatorBootInputSchema.shape, async (args) => { try { const device = args.device ?? (hasConfig() ? getConfig().defaultDeviceName : "iPhone 15"); const result = await bootDevice(device); return { content: [ { type: "text", text: JSON.stringify({ success: true, device: result, state: stateManager.getSimulator(), }, null, 2), }, ], }; } catch (error) { return handleToolError(error); } } );