Skip to main content
Glama

launch_app

Launch apps on iOS Simulator using bundle identifiers to test and interact with applications in simulated environments.

Instructions

Launches an app on the iOS Simulator by bundle identifier

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidNoUdid of target, can also be set with the IDB_UDID env var
bundle_idYesBundle identifier of the app to launch (e.g., com.apple.mobilesafari)
terminate_runningNoTerminate the app if it is already running before launching

Implementation Reference

  • The handler function that executes the launch_app tool. It resolves the device UDID if not provided, runs 'xcrun simctl launch' with optional terminate flag, extracts the PID from output, and returns success or error response.
    async ({ udid, bundle_id, terminate_running }) => { try { const actualUdid = await getBootedDeviceId(udid); // run() will throw if the command fails (non-zero exit code) const { stdout } = await run("xcrun", [ "simctl", "launch", ...(terminate_running ? ["--terminate-running-process"] : []), actualUdid, bundle_id, ]); // Extract PID from output if available // simctl launch outputs the PID as the first token in stdout const pidMatch = stdout.match(/^(\d+)/); const pid = pidMatch ? pidMatch[1] : null; return { isError: false, content: [ { type: "text", text: pid ? `App ${bundle_id} launched successfully with PID: ${pid}` : `App ${bundle_id} launched successfully`, }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: errorWithTroubleshooting( `Error launching app: ${toError(error).message}` ), }, ], }; } } );
  • Zod schema defining the input parameters for the launch_app tool: udid (optional), bundle_id (required), terminate_running (optional).
    { udid: z .string() .regex(UDID_REGEX) .optional() .describe("Udid of target, can also be set with the IDB_UDID env var"), bundle_id: z .string() .max(256) .describe( "Bundle identifier of the app to launch (e.g., com.apple.mobilesafari)" ), terminate_running: z .boolean() .optional() .describe( "Terminate the app if it is already running before launching" ), },
  • src/index.ts:933-1000 (registration)
    The server.tool call that registers the launch_app tool, including schema and handler, guarded by isToolFiltered check.
    if (!isToolFiltered("launch_app")) { server.tool( "launch_app", "Launches an app on the iOS Simulator by bundle identifier", { udid: z .string() .regex(UDID_REGEX) .optional() .describe("Udid of target, can also be set with the IDB_UDID env var"), bundle_id: z .string() .max(256) .describe( "Bundle identifier of the app to launch (e.g., com.apple.mobilesafari)" ), terminate_running: z .boolean() .optional() .describe( "Terminate the app if it is already running before launching" ), }, async ({ udid, bundle_id, terminate_running }) => { try { const actualUdid = await getBootedDeviceId(udid); // run() will throw if the command fails (non-zero exit code) const { stdout } = await run("xcrun", [ "simctl", "launch", ...(terminate_running ? ["--terminate-running-process"] : []), actualUdid, bundle_id, ]); // Extract PID from output if available // simctl launch outputs the PID as the first token in stdout const pidMatch = stdout.match(/^(\d+)/); const pid = pidMatch ? pidMatch[1] : null; return { isError: false, content: [ { type: "text", text: pid ? `App ${bundle_id} launched successfully with PID: ${pid}` : `App ${bundle_id} launched successfully`, }, ], }; } catch (error) { return { isError: true, content: [ { type: "text", text: errorWithTroubleshooting( `Error launching app: ${toError(error).message}` ), }, ], }; } } ); }

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/joshuayoes/ios-simulator-mcp'

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