Skip to main content
Glama

ios_boot_simulator

Start an iOS simulator for development and testing by providing its unique device identifier (UDID).

Instructions

Boot an iOS simulator

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidYesSimulator UDID

Implementation Reference

  • Handler function that boots the iOS simulator using xcrun simctl boot. Includes platform check, input validation with Zod schema, UDID format validation, handles already booted case (exit code 164), and returns structured response.
    handler: async (args: any) => {
      checkMacOS();
    
      const validation = IosSimulatorActionSchema.safeParse(args);
      if (!validation.success) {
        throw new Error(`Invalid request: ${validation.error.message}`);
      }
    
      const { udid } = validation.data;
    
      // Validate UDID format
      if (!validateUDID(udid)) {
        throw new Error(`Invalid simulator UDID format. UDID must be in format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX: ${udid}`);
      }
    
      const result = await processExecutor.execute('xcrun', ['simctl', 'boot', udid], {
        timeout: 60000, // 1 minute timeout for simulator boot
      });
    
      // Note: simctl boot returns exit code 164 if simulator is already booted, which is not an error
      if (result.exitCode !== 0 && result.exitCode !== 164) {
        throw new Error(`Failed to boot iOS simulator: ${result.stderr}`);
      }
    
      const isAlreadyBooted = result.exitCode === 164;
    
      return {
        success: true,
        data: {
          udid,
          status: isAlreadyBooted ? 'already_booted' : 'booted',
          message: isAlreadyBooted ? 'Simulator was already booted' : 'Simulator booted successfully',
          output: result.stdout,
        },
      };
    }
  • Registration of the ios_boot_simulator tool in the createIOSTools factory function, including name, description, JSON input schema, and handler reference.
    tools.set('ios_boot_simulator', {
      name: 'ios_boot_simulator',
      description: 'Boot an iOS simulator',
      inputSchema: {
        type: 'object',
        properties: {
          udid: { type: 'string', minLength: 1, description: 'Simulator UDID' }
        },
        required: ['udid']
      },
      handler: async (args: any) => {
        checkMacOS();
    
        const validation = IosSimulatorActionSchema.safeParse(args);
        if (!validation.success) {
          throw new Error(`Invalid request: ${validation.error.message}`);
        }
    
        const { udid } = validation.data;
    
        // Validate UDID format
        if (!validateUDID(udid)) {
          throw new Error(`Invalid simulator UDID format. UDID must be in format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX: ${udid}`);
        }
    
        const result = await processExecutor.execute('xcrun', ['simctl', 'boot', udid], {
          timeout: 60000, // 1 minute timeout for simulator boot
        });
    
        // Note: simctl boot returns exit code 164 if simulator is already booted, which is not an error
        if (result.exitCode !== 0 && result.exitCode !== 164) {
          throw new Error(`Failed to boot iOS simulator: ${result.stderr}`);
        }
    
        const isAlreadyBooted = result.exitCode === 164;
    
        return {
          success: true,
          data: {
            udid,
            status: isAlreadyBooted ? 'already_booted' : 'booted',
            message: isAlreadyBooted ? 'Simulator was already booted' : 'Simulator booted successfully',
            output: result.stdout,
          },
        };
      }
    });
  • Zod schema for validating input parameters (udid) used in the ios_boot_simulator handler and other simulator action tools.
    const IosSimulatorActionSchema = z.object({
      udid: z.string().min(1),
    });
  • Helper function to validate that the platform is macOS (darwin), required for iOS tools including ios_boot_simulator.
    const checkMacOS = (): void => {
      if (process.platform !== 'darwin') {
        throw new Error(`iOS development tools only work on macOS. Current platform: ${process.platform}`);
      }
    };
  • Helper function to validate iOS simulator UDID format (UUID v4), used in the ios_boot_simulator handler.
    const validateUDID = (udid: string): boolean => {
      const uuidPattern = /^[A-F0-9]{8}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{4}-[A-F0-9]{12}$/i;
      return uuidPattern.test(udid);
    };
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Boot') but doesn't explain what booting entails (e.g., starting a virtual device, potential delays, or system requirements), whether it's idempotent, or what happens on failure. This leaves significant gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like error handling, side effects, or return values, leaving the agent with insufficient context to use the tool effectively beyond the basic action.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'udid' parameter clearly documented as 'Simulator UDID'. The description doesn't add any additional meaning beyond this, such as where to obtain the UDID or format details, which aligns with the baseline score when schema coverage is high.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Boot an iOS simulator' clearly states the verb ('Boot') and resource ('iOS simulator'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'ios_shutdown_simulator' or 'flutter_launch_emulator' beyond the iOS focus, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a simulator UDID from 'ios_list_simulators'), when not to use it (e.g., if already booted), or how it relates to sibling tools like 'ios_shutdown_simulator' or 'flutter_launch_emulator'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/cristianoaredes/mcp-mobile-server'

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