Skip to main content
Glama

boot_sim

Start an iOS simulator by providing its UUID to enable testing and development of iOS applications.

Instructions

Boots an iOS simulator. IMPORTANT: You MUST provide the simulatorUuid parameter. Example: boot_sim({ simulatorUuid: 'YOUR_UUID_HERE' })

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
simulatorUuidYesUUID of the simulator to use (obtained from list_simulators)

Implementation Reference

  • The core handler function for the 'boot_sim' tool. Validates the simulatorUuid parameter, executes 'xcrun simctl boot' command, handles success/error responses, and provides next-step instructions.
        async (params): Promise<ToolResponse> => {
          const simulatorUuidValidation = validateRequiredParam('simulatorUuid', params.simulatorUuid);
          if (!simulatorUuidValidation.isValid) {
            return simulatorUuidValidation.errorResponse!;
          }
    
          log('info', `Starting xcrun simctl boot request for simulator ${params.simulatorUuid}`);
    
          try {
            const command = ['xcrun', 'simctl', 'boot', params.simulatorUuid];
            const result = await executeCommand(command, 'Boot Simulator');
    
            if (!result.success) {
              return {
                content: [
                  {
                    type: 'text',
                    text: `Boot simulator operation failed: ${result.error}`,
                  },
                ],
              };
            }
    
            return {
              content: [
                {
                  type: 'text',
                  text: `Simulator booted successfully. Next steps:
    1. Open the Simulator app: open_sim({ enabled: true })
    2. Install an app: install_app_sim({ simulatorUuid: "${params.simulatorUuid}", appPath: "PATH_TO_YOUR_APP" })
    3. Launch an app: launch_app_sim({ simulatorUuid: "${params.simulatorUuid}", bundleId: "YOUR_APP_BUNDLE_ID" })
    4. Log capture options:
       - Option 1: Capture structured logs only (app continues running):
         start_sim_log_cap({ simulatorUuid: "${params.simulatorUuid}", bundleId: "YOUR_APP_BUNDLE_ID" })
       - Option 2: Capture both console and structured logs (app will restart):
         start_sim_log_cap({ simulatorUuid: "${params.simulatorUuid}", bundleId: "YOUR_APP_BUNDLE_ID", captureConsole: true })
       - Option 3: Launch app with logs in one step:
         launch_app_logs_sim({ simulatorUuid: "${params.simulatorUuid}", bundleId: "YOUR_APP_BUNDLE_ID" })`,
                },
              ],
            };
          } catch (error) {
            const errorMessage = error instanceof Error ? error.message : String(error);
            log('error', `Error during boot simulator operation: ${errorMessage}`);
            return {
              content: [
                {
                  type: 'text',
                  text: `Boot simulator operation failed: ${errorMessage}`,
                },
              ],
            };
          }
  • Input schema using Zod for the 'boot_sim' tool, defining the required 'simulatorUuid' string parameter.
      simulatorUuid: z
        .string()
        .describe('UUID of the simulator to use (obtained from list_simulators)'),
    },
  • Local registration function that registers the 'boot_sim' tool on the MCP server, including name, description, input schema, and handler.
    export function registerBootSimulatorTool(server: McpServer): void {
      server.tool(
        'boot_sim',
        "Boots an iOS simulator. IMPORTANT: You MUST provide the simulatorUuid parameter. Example: boot_sim({ simulatorUuid: 'YOUR_UUID_HERE' })",
        {
          simulatorUuid: z
            .string()
            .describe('UUID of the simulator to use (obtained from list_simulators)'),
        },
        async (params): Promise<ToolResponse> => {
          const simulatorUuidValidation = validateRequiredParam('simulatorUuid', params.simulatorUuid);
          if (!simulatorUuidValidation.isValid) {
            return simulatorUuidValidation.errorResponse!;
          }
    
          log('info', `Starting xcrun simctl boot request for simulator ${params.simulatorUuid}`);
    
          try {
            const command = ['xcrun', 'simctl', 'boot', params.simulatorUuid];
            const result = await executeCommand(command, 'Boot Simulator');
    
            if (!result.success) {
              return {
                content: [
                  {
                    type: 'text',
                    text: `Boot simulator operation failed: ${result.error}`,
                  },
                ],
              };
            }
    
            return {
              content: [
                {
                  type: 'text',
                  text: `Simulator booted successfully. Next steps:
    1. Open the Simulator app: open_sim({ enabled: true })
    2. Install an app: install_app_sim({ simulatorUuid: "${params.simulatorUuid}", appPath: "PATH_TO_YOUR_APP" })
    3. Launch an app: launch_app_sim({ simulatorUuid: "${params.simulatorUuid}", bundleId: "YOUR_APP_BUNDLE_ID" })
    4. Log capture options:
       - Option 1: Capture structured logs only (app continues running):
         start_sim_log_cap({ simulatorUuid: "${params.simulatorUuid}", bundleId: "YOUR_APP_BUNDLE_ID" })
       - Option 2: Capture both console and structured logs (app will restart):
         start_sim_log_cap({ simulatorUuid: "${params.simulatorUuid}", bundleId: "YOUR_APP_BUNDLE_ID", captureConsole: true })
       - Option 3: Launch app with logs in one step:
         launch_app_logs_sim({ simulatorUuid: "${params.simulatorUuid}", bundleId: "YOUR_APP_BUNDLE_ID" })`,
                },
              ],
            };
          } catch (error) {
            const errorMessage = error instanceof Error ? error.message : String(error);
            log('error', `Error during boot simulator operation: ${errorMessage}`);
            return {
              content: [
                {
                  type: 'text',
                  text: `Boot simulator operation failed: ${errorMessage}`,
                },
              ],
            };
          }
        },
      );
    }
  • Global tool registration configuration for 'boot_simulator' tool, imported from simulator.ts and enabled via environment variable.
      register: registerBootSimulatorTool,
      groups: [ToolGroup.SIMULATOR_MANAGEMENT, ToolGroup.IOS_SIMULATOR_WORKFLOW],
      envVar: 'XCODEBUILDMCP_TOOL_BOOT_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