Skip to main content
Glama

adb_install_app

Install APK files on Android devices using Android Debug Bridge commands to deploy applications for testing or management.

Instructions

Install an APK file on the device

Input Schema

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

Implementation Reference

  • The installApp method in the AppTools class that implements the core logic for installing an APK using adb install command, including device connection check and result parsing.
    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 input schema definition for the adb_install_app tool, specifying parameters apkPath (required) and deviceId (optional).
    { 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 in the CallToolRequest handler that routes calls to adb_install_app 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