adb_uninstall_app
Remove specific Android apps from devices by specifying the package name using Android Debug Bridge functionality. Manage app installations remotely with optional device ID targeting.
Instructions
Uninstall an app from the device
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deviceId | No | Device ID (optional) | |
| packageName | Yes | Package name of the app to uninstall |
Implementation Reference
- src/tools/app.ts:43-76 (handler)The core handler function in AppTools class that performs the ADB uninstall operation by executing the 'uninstall' command via adbClient.async uninstallApp(packageName: string, deviceId?: string) { try { const connected = await this.adbClient.isDeviceConnected(deviceId); if (!connected) { return { success: false, error: 'Device not connected', message: 'Cannot uninstall app - device is not connected' }; } const command = `uninstall ${packageName}`; 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 uninstall app' }; } return { success: true, data: { packageName, deviceId: deviceId || this.adbClient.getDefaultDevice() }, message: `App ${packageName} uninstalled successfully` }; } catch (error: any) { return { success: false, error: error.message, message: 'Failed to uninstall app' }; }
- src/index.ts:220-235 (schema)The input schema definition for the adb_uninstall_app tool, specifying packageName as required and deviceId as optional.name: 'adb_uninstall_app', description: 'Uninstall an app from the device', inputSchema: { type: 'object', properties: { packageName: { type: 'string', description: 'Package name of the app to uninstall', }, deviceId: { type: 'string', description: 'Device ID (optional)', }, }, required: ['packageName'], },
- src/index.ts:455-456 (registration)The switch case in the CallToolRequest handler that dispatches to the appTools.uninstallApp method.case 'adb_uninstall_app': return await this.handleToolCall(this.appTools.uninstallApp(args?.packageName as string, args?.deviceId as string));
- src/index.ts:39-39 (registration)Instantiation of the AppTools class instance used for app-related tools including uninstall.this.appTools = new AppTools(this.adbClient);