Skip to main content
Glama

adb_install_app

Install APK files on Android devices using device-specific or default configurations. Streamline app deployment and management with direct integration into the ADB MCP Server for automated Android device operations.

Instructions

Install an APK file on the device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apkPathYesPath to the APK file
deviceIdNoDevice ID (optional)

Implementation Reference

  • The core handler function in AppTools class that performs the ADB install command on the specified APK file, checks device connection, executes the command, and returns success/error details.
    async installApp(apkPath: string, deviceId?: string) { try { const connected = await this.adbClient.isDeviceConnected(deviceId); if (!connected) { return { success: false, error: 'Device not connected', message: 'Cannot install app - device is not connected' }; } const command = `install "${apkPath}"`; const result = await this.adbClient.executeCommand(command, deviceId); if (!result.success || result.output.includes('Failure')) { return { success: false, error: result.error || result.output, message: 'Failed to install app' }; } return { success: true, data: { apkPath, deviceId: deviceId || this.adbClient.getDefaultDevice() }, message: `App installed successfully from ${apkPath}` }; } catch (error: any) { return { success: false, error: error.message, message: 'Failed to install app' }; } }
  • The tool schema definition including name, description, and input schema (apkPath required, deviceId optional) used for tool listing and validation.
    { name: 'adb_install_app', description: 'Install an APK file on the device', inputSchema: { type: 'object', properties: { apkPath: { type: 'string', description: 'Path to the APK file', }, deviceId: { type: 'string', description: 'Device ID (optional)', }, }, required: ['apkPath'], }, },
  • src/index.ts:453-454 (registration)
    The switch case registration that dispatches calls to the adb_install_app tool to the AppTools.installApp method.
    case 'adb_install_app': return await this.handleToolCall(this.appTools.installApp(args?.apkPath as string, args?.deviceId as 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/richard0913/adb-mcp'

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