Skip to main content
Glama

android_launch_app

Launch Android applications by specifying their package name, enabling quick app access and testing on connected devices through automated execution.

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

  • The primary handler function for the 'android_launch_app' tool. Validates input arguments and calls the ADB wrapper to launch the app, returning success or error message.
    /** * Handle launch app tool call */ 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)}`); } }
  • Core implementation in ADBWrapper that executes the ADB shell monkey command to launch the specified Android app package using the LAUNCHER intent.
    * Launch an app by package name */ 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); }
  • Tool schema definition including name, description, and input schema (packageName required, deviceSerial optional) provided in the ListTools response.
    { 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 switch statement of the CallToolRequestSchema handler, mapping the tool name to its handler function.
    case 'android_launch_app': return await launchAppHandler(this.adb, args);
  • TypeScript interface defining the expected arguments for the launchAppHandler, matching the MCP input schema.
    interface LaunchAppArgs { packageName: string; deviceSerial?: string; }

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