Skip to main content
Glama

open_sim

Launch the iOS Simulator app directly by enabling the tool, simplifying the process of testing iOS applications on the sl-test MCP server.

Instructions

Opens the iOS Simulator app.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
enabledYes

Implementation Reference

  • The handler function for the 'open_sim' tool, which launches the iOS Simulator application using the 'open -a Simulator' command and provides next steps guidance.
    server.tool( 'open_sim', 'Opens the iOS Simulator app.', { enabled: z.boolean(), }, async (): Promise<ToolResponse> => { log('info', 'Starting open simulator request'); try { const command = ['open', '-a', 'Simulator']; const result = await executeCommand(command, 'Open Simulator'); 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({ simulatorUuid: '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({ simulatorUuid: 'UUID', bundleId: 'YOUR_APP_BUNDLE_ID' }) - Option 2: Capture both console and structured logs (app will restart): start_sim_log_cap({ simulatorUuid: 'UUID', bundleId: 'YOUR_APP_BUNDLE_ID', captureConsole: true }) - Option 3: Launch app with logs in one step: launch_app_logs_sim({ simulatorUuid: '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}`, }, ], }; } }, );
  • Input schema for the 'open_sim' tool using Zod validation.
    enabled: z.boolean(), },
  • The registration function that sets up the 'open_sim' tool on the MCP server.
    export function registerOpenSimulatorTool(server: McpServer): void { server.tool( 'open_sim', 'Opens the iOS Simulator app.', { enabled: z.boolean(), }, async (): Promise<ToolResponse> => { log('info', 'Starting open simulator request'); try { const command = ['open', '-a', 'Simulator']; const result = await executeCommand(command, 'Open Simulator'); 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({ simulatorUuid: '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({ simulatorUuid: 'UUID', bundleId: 'YOUR_APP_BUNDLE_ID' }) - Option 2: Capture both console and structured logs (app will restart): start_sim_log_cap({ simulatorUuid: 'UUID', bundleId: 'YOUR_APP_BUNDLE_ID', captureConsole: true }) - Option 3: Launch app with logs in one step: launch_app_logs_sim({ simulatorUuid: '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}`, }, ], }; } }, ); }
  • Configuration object used to conditionally register the open_sim tool via registerIfEnabled.
    register: registerOpenSimulatorTool, groups: [ToolGroup.SIMULATOR_MANAGEMENT, ToolGroup.IOS_SIMULATOR_WORKFLOW], envVar: 'XCODEBUILDMCP_TOOL_OPEN_SIMULATOR', },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SampsonKY/XcodeBuildMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server