Skip to main content
Glama

android_launch_app

Launch Android applications by specifying their package name, enabling quick app access for testing or automation workflows.

Instructions

Launch an Android app by package name

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageNameYesPackage name of the app to launch (e.g., com.example.app)
deviceSerialNoSpecific device serial number to target (optional)

Implementation Reference

  • Core handler function for the 'android_launch_app' tool. Validates arguments, calls ADBWrapper.launchApp, and returns success/error response.
    export async function launchAppHandler( adb: ADBWrapper, args: any ): Promise<{ content: Array<{ type: string; text: string }> }> { const { packageName, deviceSerial } = args as LaunchAppArgs; if (!packageName || typeof packageName !== 'string') { throw new Error('Invalid package name: packageName must be a non-empty string'); } try { await adb.launchApp(packageName, deviceSerial); return { content: [ { type: 'text', text: `Successfully launched app: ${packageName}`, }, ], }; } catch (error) { throw new Error(`Launch app failed: ${error instanceof Error ? error.message : String(error)}`); } }
  • MCP tool schema definition for 'android_launch_app', including input schema with packageName (required) and optional deviceSerial.
    { name: 'android_launch_app', description: 'Launch an Android app by package name', inputSchema: { type: 'object', properties: { packageName: { type: 'string', description: 'Package name of the app to launch (e.g., com.example.app)', }, deviceSerial: { type: 'string', description: 'Specific device serial number to target (optional)', }, }, required: ['packageName'], }, },
  • src/index.ts:470-471 (registration)
    Tool dispatch registration in the CallToolRequestSchema handler switch statement.
    case 'android_launch_app': return await launchAppHandler(this.adb, args);
  • TypeScript interface defining input arguments for the launchAppHandler.
    interface LaunchAppArgs { packageName: string; deviceSerial?: string; }
  • Low-level ADB command execution: launches app using 'adb shell monkey -p <package> -c android.intent.category.LAUNCHER 1'
    async launchApp(packageName: string, deviceSerial?: string): Promise<void> { const device = await this.getTargetDevice(deviceSerial); await this.exec(['shell', 'monkey', '-p', packageName, '-c', 'android.intent.category.LAUNCHER', '1'], device); }

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/jduartedj/android-mcp-server'

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