list_simulators
Retrieve all available iOS simulators and their current status, such as Booted or Shutdown, for device management and automation.
Instructions
List all available iOS simulators with their state (Booted, Shutdown, etc.)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:544-571 (handler)The handler function 'listSimulators' executes 'xcrun simctl list devices --json' and formats the available simulator data.
private async listSimulators() { try { const { stdout } = await execAsync('xcrun simctl list devices --json'); const data = JSON.parse(stdout) as { devices: Record<string, SimulatorDevice[]> }; const simulators: Array<{ runtime: string } & SimulatorDevice> = []; for (const [runtime, devices] of Object.entries(data.devices)) { for (const device of devices) { if (device.isAvailable) { simulators.push({ runtime: runtime.replace('com.apple.CoreSimulator.SimRuntime.', ''), udid: device.udid, name: device.name, state: device.state, isAvailable: device.isAvailable, }); } } } const booted = simulators.filter((s) => s.state === 'Booted'); return { content: [{ type: 'text', text: JSON.stringify({ booted: booted.length, simulators }, null, 2), }], }; } catch (error: any) { - src/index.ts:279-283 (registration)Tool definition and registration for 'list_simulators' within 'setupToolHandlers'.
{ name: 'list_simulators', description: 'List all available iOS simulators with their state (Booted, Shutdown, etc.)', inputSchema: { type: 'object', properties: {}, additionalProperties: false }, },