Skip to main content
Glama

adb_start_app

Start Android applications on connected devices by specifying package names, enabling automated app launching for testing and management workflows.

Instructions

Start an app on the device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
packageNameYesPackage name of the app to start
activityNameNoActivity name (optional)
deviceIdNoDevice ID (optional)

Implementation Reference

  • The startApp method in AppTools class implements the core logic for the adb_start_app tool. It checks device connectivity, constructs the appropriate ADB shell command (am start or monkey), executes it via AdbClient, and returns success/error details.
    async startApp(packageName: string, activityName?: string, deviceId?: string) { try { const connected = await this.adbClient.isDeviceConnected(deviceId); if (!connected) { return { success: false, error: 'Device not connected', message: 'Cannot start app - device is not connected' }; } let command: string; if (activityName) { command = `shell am start -n ${packageName}/${activityName}`; } else { command = `shell monkey -p ${packageName} -c android.intent.category.LAUNCHER 1`; } const result = await this.adbClient.executeCommand(command, deviceId); if (!result.success) { return { success: false, error: result.error, message: 'Failed to start app' }; } return { success: true, data: { packageName, activityName, deviceId: deviceId || this.adbClient.getDefaultDevice() }, message: `App ${packageName} started successfully` }; } catch (error: any) { return { success: false, error: error.message, message: 'Failed to start app' }; } }
  • Input schema definition for the adb_start_app tool in the ListTools response, defining parameters: packageName (required), activityName and deviceId (optional).
    name: 'adb_start_app', description: 'Start an app on the device', inputSchema: { type: 'object', properties: { packageName: { type: 'string', description: 'Package name of the app to start', }, activityName: { type: 'string', description: 'Activity name (optional)', }, deviceId: { type: 'string', description: 'Device ID (optional)', }, }, required: ['packageName'], },
  • src/index.ts:457-458 (registration)
    Registration and dispatch in the CallToolRequest handler switch statement, mapping 'adb_start_app' calls to this.appTools.startApp method.
    case 'adb_start_app': return await this.handleToolCall(this.appTools.startApp(args?.packageName as string, args?.activityName as string, args?.deviceId as string));
  • src/index.ts:39-39 (registration)
    Instantiation of AppTools class instance used for app-related tools including startApp.
    this.appTools = new AppTools(this.adbClient);

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/richard0913/adb-mcp'

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