Skip to main content
Glama

launch_app

Launch installed Android or iOS apps on devices or simulators to test functionality across platforms. Specify platform, app identifier, and optional device selection or data clearing.

Instructions

Launch an installed app on a device or simulator.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformYesTarget platform
appIdYesPackage name (Android) or bundle ID (iOS)
deviceIdNoDevice ID or name (optional, uses first running device if not specified)
clearDataNoClear app data before launch (Android only, default: false)
launchArgumentsNoArguments to pass to the app (iOS only)

Implementation Reference

  • Main handler function for the 'launch_app' MCP tool. Validates inputs and dispatches to platform-specific launch functions.
    export async function launchApp(args: LaunchAppArgs): Promise<LaunchResult> {
      const { platform, appId, deviceId, clearData = false, launchArguments } = args;
    
      // Validate platform
      if (!isPlatform(platform)) {
        throw Errors.invalidArguments(`Invalid platform: ${platform}. Must be 'android' or 'ios'`);
      }
    
      // Validate app ID
      if (!appId || appId.trim().length === 0) {
        throw Errors.invalidArguments('appId is required');
      }
    
      if (platform === 'android') {
        return launchAndroid(appId, deviceId, clearData);
      } else {
        return launchIOS(appId, deviceId, launchArguments);
      }
    }
  • TypeScript interfaces defining input arguments (LaunchAppArgs) and output (LaunchResult) for the launch_app tool.
    export interface LaunchAppArgs {
      /** Target platform */
      platform: string;
      /** Package name (Android) or bundle ID (iOS) */
      appId: string;
      /** Target device ID or name (optional, uses first available if not specified) */
      deviceId?: string;
      /** Clear app data before launch (Android only) */
      clearData?: boolean;
      /** Arguments to pass to the app (iOS only) */
      launchArguments?: string[];
    }
    
    /**
     * Result of launch operation
     */
    export interface LaunchResult {
      success: boolean;
      platform: Platform;
      deviceId: string;
      deviceName: string;
      appId: string;
    }
  • Registers the 'launch_app' tool with the global tool registry, providing description, JSON input schema, and the handler function.
    export function registerLaunchAppTool(): void {
      getToolRegistry().register(
        'launch_app',
        {
          description: 'Launch an installed app on a device or simulator.',
          inputSchema: createInputSchema(
            {
              platform: {
                type: 'string',
                enum: ['android', 'ios'],
                description: 'Target platform',
              },
              appId: {
                type: 'string',
                description: 'Package name (Android) or bundle ID (iOS)',
              },
              deviceId: {
                type: 'string',
                description: 'Device ID or name (optional, uses first running device if not specified)',
              },
              clearData: {
                type: 'boolean',
                description: 'Clear app data before launch (Android only, default: false)',
              },
              launchArguments: {
                type: 'array',
                items: { type: 'string' },
                description: 'Arguments to pass to the app (iOS only)',
              },
            },
            ['platform', 'appId']
          ),
        },
        (args) => launchApp(args as unknown as LaunchAppArgs)
      );
    }
  • Internal helper function to launch Android app: finds device, launches via adb, returns result.
    async function launchAndroid(
      packageName: string,
      deviceId?: string,
      clearData?: boolean
    ): Promise<LaunchResult> {
      // Find device if not specified
      let targetDevice: { id: string; name: string };
    
      if (deviceId) {
        const devices = await listAndroidDevices();
        const found = devices.find(
          (d) => d.id === deviceId || d.name === deviceId || d.model === deviceId
        );
        if (!found) {
          throw Errors.deviceNotFound(deviceId, devices.map((d) => `${d.id} (${d.name})`));
        }
        targetDevice = { id: found.id, name: found.name };
      } else {
        const devices = await listAndroidDevices();
        const bootedDevice = devices.find((d) => d.status === 'booted');
        if (!bootedDevice) {
          throw Errors.invalidArguments('No running Android device found. Boot a device first.');
        }
        targetDevice = { id: bootedDevice.id, name: bootedDevice.name };
      }
    
      // Launch the app
      await launchAndroidApp(packageName, targetDevice.id, { clearData });
    
      return {
        success: true,
        platform: 'android',
        deviceId: targetDevice.id,
        deviceName: targetDevice.name,
        appId: packageName,
      };
    }
  • Internal helper function to launch iOS app: finds simulator, launches via simctl, returns result.
    async function launchIOS(
      bundleId: string,
      deviceId?: string,
      launchArguments?: string[]
    ): Promise<LaunchResult> {
      // Find device if not specified
      let targetDevice: { id: string; name: string };
    
      if (deviceId) {
        const devices = await listIOSDevices();
        const found = devices.find((d) => d.id === deviceId || d.name === deviceId);
        if (!found) {
          throw Errors.deviceNotFound(deviceId, devices.map((d) => `${d.id} (${d.name})`));
        }
        targetDevice = { id: found.id, name: found.name };
      } else {
        const bootedDevice = await getBootedDevice();
        if (!bootedDevice) {
          throw Errors.invalidArguments('No running iOS simulator found. Boot a simulator first.');
        }
        targetDevice = { id: bootedDevice.id, name: bootedDevice.name };
      }
    
      // Launch the app
      await launchIOSApp(bundleId, targetDevice.id, { arguments: launchArguments });
    
      return {
        success: true,
        platform: 'ios',
        deviceId: targetDevice.id,
        deviceName: targetDevice.name,
        appId: bundleId,
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions launching an app but fails to describe key behaviors such as what happens if the app is not installed, whether the launch is synchronous or asynchronous, error handling, or platform-specific quirks (e.g., iOS vs. Android differences beyond parameters). This leaves significant gaps for an agent to understand the tool's behavior.

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, clear sentence that directly states the tool's purpose without any fluff or redundancy. It is front-loaded and efficiently communicates the core action, making it easy to parse and understand quickly.

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?

Given the complexity of launching apps across platforms with no annotations and no output schema, the description is insufficient. It lacks details on behavioral outcomes, error conditions, and what the tool returns (e.g., success/failure status, process ID). For a tool with 5 parameters and platform-specific behaviors, more context is needed to be complete.

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, providing detailed explanations for all 5 parameters, including platform-specific notes (e.g., 'Android only' for clearData, 'iOS only' for launchArguments). The description adds no additional parameter semantics beyond what the schema already covers, so it meets the baseline of 3 for high schema coverage without extra value.

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 clearly states the action ('launch') and target ('an installed app on a device or simulator'), which is specific and unambiguous. However, it does not explicitly distinguish this tool from sibling tools like 'install_app' or 'deep_link_navigate', which could involve app-related actions, leaving some room for sibling differentiation.

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. For example, it does not mention when to choose 'launch_app' over 'install_app' (for launching after installation) or 'deep_link_navigate' (for launching with specific intents), nor does it specify prerequisites like having an app already installed. This lack of context makes usage unclear.

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/abd3lraouf/specter-mcp'

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