Skip to main content
Glama

launch_app_sim

Launch iOS apps in simulators by providing simulator UUID and bundle identifier for testing and development workflows.

Instructions

Launches an app in an iOS simulator. IMPORTANT: You MUST provide both the simulatorUuid and bundleId parameters.

Note: You must install the app in the simulator before launching. The typical workflow is: build → install → launch. Example: launch_app_sim({ simulatorUuid: 'YOUR_UUID_HERE', bundleId: 'com.example.MyApp' })

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
simulatorUuidYesUUID of the simulator to use (obtained from list_simulators)
bundleIdYesBundle identifier of the app to launch (e.g., 'com.example.MyApp')
argsNoAdditional arguments to pass to the app

Implementation Reference

  • The core handler function for the 'launch_app_sim' tool. It validates inputs, checks if the app is installed using 'xcrun simctl get_app_container', launches the app with 'xcrun simctl launch', handles success/error responses, and suggests next steps for log capturing.
        async (params): Promise<ToolResponse> => {
          const simulatorUuidValidation = validateRequiredParam('simulatorUuid', params.simulatorUuid);
          if (!simulatorUuidValidation.isValid) {
            return simulatorUuidValidation.errorResponse!;
          }
    
          const bundleIdValidation = validateRequiredParam('bundleId', params.bundleId);
          if (!bundleIdValidation.isValid) {
            return bundleIdValidation.errorResponse!;
          }
    
          log('info', `Starting xcrun simctl launch request for simulator ${params.simulatorUuid}`);
    
          // Check if the app is installed in the simulator
          try {
            const getAppContainerCmd = [
              'xcrun',
              'simctl',
              'get_app_container',
              params.simulatorUuid,
              params.bundleId,
              'app',
            ];
            const getAppContainerResult = await executeCommand(
              getAppContainerCmd,
              'Check App Installed',
            );
            if (!getAppContainerResult.success) {
              return {
                content: [
                  {
                    type: 'text',
                    text: `App is not installed on the simulator. Please use install_app_in_simulator before launching.\n\nWorkflow: build → install → launch.`,
                  },
                ],
                isError: true,
              };
            }
          } catch {
            return {
              content: [
                {
                  type: 'text',
                  text: `App is not installed on the simulator (check failed). Please use install_app_in_simulator before launching.\n\nWorkflow: build → install → launch.`,
                },
              ],
              isError: true,
            };
          }
    
          try {
            const command = ['xcrun', 'simctl', 'launch', params.simulatorUuid, params.bundleId];
    
            if (params.args && params.args.length > 0) {
              command.push(...params.args);
            }
    
            const result = await executeCommand(command, 'Launch App in Simulator');
    
            if (!result.success) {
              return {
                content: [
                  {
                    type: 'text',
                    text: `Launch app in simulator operation failed: ${result.error}`,
                  },
                ],
              };
            }
    
            return {
              content: [
                {
                  type: 'text',
                  text: `App launched successfully in simulator ${params.simulatorUuid}`,
                },
                {
                  type: 'text',
                  text: `Next Steps:
    1. You can now interact with the app in the simulator.
    2. Log capture options:
       - Option 1: Capture structured logs only (app continues running):
         start_sim_log_cap({ simulatorUuid: "${params.simulatorUuid}", bundleId: "${params.bundleId}" })
       - Option 2: Capture both console and structured logs (app will restart):
         start_sim_log_cap({ simulatorUuid: "${params.simulatorUuid}", bundleId: "${params.bundleId}", captureConsole: true })
       - Option 3: Restart with logs in one step:
         launch_app_logs_sim({ simulatorUuid: "${params.simulatorUuid}", bundleId: "${params.bundleId}" })
    
    3. When done with any option, use: stop_sim_log_cap({ logSessionId: 'SESSION_ID' })`,
                },
              ],
            };
          } catch (error) {
            const errorMessage = error instanceof Error ? error.message : String(error);
            log('error', `Error during launch app in simulator operation: ${errorMessage}`);
            return {
              content: [
                {
                  type: 'text',
                  text: `Launch app in simulator operation failed: ${errorMessage}`,
                },
              ],
            };
          }
        },
  • Zod schema defining the input parameters for the 'launch_app_sim' tool: required simulatorUuid and bundleId, optional args array.
    {
      simulatorUuid: z
        .string()
        .describe('UUID of the simulator to use (obtained from list_simulators)'),
      bundleId: z
        .string()
        .describe("Bundle identifier of the app to launch (e.g., 'com.example.MyApp')"),
      args: z.array(z.string()).optional().describe('Additional arguments to pass to the app'),
    },
  • The registration function that defines and registers the 'launch_app_sim' tool on the MCP server using server.tool(), including name, description, schema, and handler.
    export function registerLaunchAppInSimulatorTool(server: McpServer): void {
      server.tool(
        'launch_app_sim',
        "Launches an app in an iOS simulator. IMPORTANT: You MUST provide both the simulatorUuid and bundleId parameters.\n\nNote: You must install the app in the simulator before launching. The typical workflow is: build → install → launch. Example: launch_app_sim({ simulatorUuid: 'YOUR_UUID_HERE', bundleId: 'com.example.MyApp' })",
        {
          simulatorUuid: z
            .string()
            .describe('UUID of the simulator to use (obtained from list_simulators)'),
          bundleId: z
            .string()
            .describe("Bundle identifier of the app to launch (e.g., 'com.example.MyApp')"),
          args: z.array(z.string()).optional().describe('Additional arguments to pass to the app'),
        },
        async (params): Promise<ToolResponse> => {
          const simulatorUuidValidation = validateRequiredParam('simulatorUuid', params.simulatorUuid);
          if (!simulatorUuidValidation.isValid) {
            return simulatorUuidValidation.errorResponse!;
          }
    
          const bundleIdValidation = validateRequiredParam('bundleId', params.bundleId);
          if (!bundleIdValidation.isValid) {
            return bundleIdValidation.errorResponse!;
          }
    
          log('info', `Starting xcrun simctl launch request for simulator ${params.simulatorUuid}`);
    
          // Check if the app is installed in the simulator
          try {
            const getAppContainerCmd = [
              'xcrun',
              'simctl',
              'get_app_container',
              params.simulatorUuid,
              params.bundleId,
              'app',
            ];
            const getAppContainerResult = await executeCommand(
              getAppContainerCmd,
              'Check App Installed',
            );
            if (!getAppContainerResult.success) {
              return {
                content: [
                  {
                    type: 'text',
                    text: `App is not installed on the simulator. Please use install_app_in_simulator before launching.\n\nWorkflow: build → install → launch.`,
                  },
                ],
                isError: true,
              };
            }
          } catch {
            return {
              content: [
                {
                  type: 'text',
                  text: `App is not installed on the simulator (check failed). Please use install_app_in_simulator before launching.\n\nWorkflow: build → install → launch.`,
                },
              ],
              isError: true,
            };
          }
    
          try {
            const command = ['xcrun', 'simctl', 'launch', params.simulatorUuid, params.bundleId];
    
            if (params.args && params.args.length > 0) {
              command.push(...params.args);
            }
    
            const result = await executeCommand(command, 'Launch App in Simulator');
    
            if (!result.success) {
              return {
                content: [
                  {
                    type: 'text',
                    text: `Launch app in simulator operation failed: ${result.error}`,
                  },
                ],
              };
            }
    
            return {
              content: [
                {
                  type: 'text',
                  text: `App launched successfully in simulator ${params.simulatorUuid}`,
                },
                {
                  type: 'text',
                  text: `Next Steps:
    1. You can now interact with the app in the simulator.
    2. Log capture options:
       - Option 1: Capture structured logs only (app continues running):
         start_sim_log_cap({ simulatorUuid: "${params.simulatorUuid}", bundleId: "${params.bundleId}" })
       - Option 2: Capture both console and structured logs (app will restart):
         start_sim_log_cap({ simulatorUuid: "${params.simulatorUuid}", bundleId: "${params.bundleId}", captureConsole: true })
       - Option 3: Restart with logs in one step:
         launch_app_logs_sim({ simulatorUuid: "${params.simulatorUuid}", bundleId: "${params.bundleId}" })
    
    3. When done with any option, use: stop_sim_log_cap({ logSessionId: 'SESSION_ID' })`,
                },
              ],
            };
          } catch (error) {
            const errorMessage = error instanceof Error ? error.message : String(error);
            log('error', `Error during launch app in simulator operation: ${errorMessage}`);
            return {
              content: [
                {
                  type: 'text',
                  text: `Launch app in simulator operation failed: ${errorMessage}`,
                },
              ],
            };
          }
        },
      );
    }
  • Entry in the toolRegistrations array that includes the registerLaunchAppInSimulatorTool function, which is invoked by registerTools() to conditionally register the tool based on environment variables and tool groups.
    {
      register: registerLaunchAppInSimulatorTool,
      groups: [ToolGroup.APP_DEPLOYMENT, ToolGroup.IOS_SIMULATOR_WORKFLOW],
      envVar: 'XCODEBUILDMCP_TOOL_LAUNCH_APP_IN_SIMULATOR',
    },
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing prerequisites (app must be installed), workflow context, and providing an example. It doesn't mention error conditions, timeouts, or what happens if the app is already running, but covers essential behavioral aspects.

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

Conciseness4/5

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

The description is appropriately sized with three sentences that each earn their place: purpose statement, mandatory parameter emphasis, and workflow context with example. It's front-loaded with the core functionality. The example could be slightly more concise, but overall structure is effective.

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

Completeness4/5

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

For a tool with no annotations and no output schema, the description does well by covering purpose, prerequisites, workflow context, and parameter usage. It could benefit from mentioning what the tool returns (success/failure status) or error conditions, but given the context, it's reasonably complete.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds value by emphasizing that both simulatorUuid and bundleId are mandatory ('You MUST provide both'), explaining where to get simulatorUuid ('obtained from list_simulators' is implied in the example context), and providing a concrete example with format. However, it doesn't mention the optional 'args' parameter.

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

Purpose5/5

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

The description clearly states the specific action ('launches an app') and resource ('in an iOS simulator'), distinguishing it from sibling tools like 'install_app_sim' or 'launch_mac_app'. It precisely defines the tool's function without ambiguity.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('You must install the app in the simulator before launching') and provides a clear workflow context ('The typical workflow is: build → install → launch'). It distinguishes from installation tools by specifying the launch phase.

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/SampsonKY/XcodeBuildMCP'

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