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
| Name | Required | Description | Default |
|---|---|---|---|
| apkPath | Yes | Path to the APK file | |
| deviceId | No | Device ID (optional) |
Implementation Reference
- src/tools/app.ts:7-41 (handler)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' }; } }
- src/index.ts:201-218 (schema)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));