adb_uninstall_app
Remove apps from Android devices using ADB commands to manage device storage and performance by uninstalling specified applications.
Instructions
Uninstall an app from the device
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"packageName": "<packageName>"
},
"name": "adb_uninstall_app"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| packageName | Yes | Package name of the app to uninstall | |
| deviceId | No | Device ID (optional) |
Implementation Reference
- src/tools/app.ts:43-77 (handler)The core handler function in AppTools class that performs the ADB uninstall operation by executing the 'adb uninstall' command, checks device connectivity, handles errors, and returns structured result.
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 and metadata definition for the 'adb_uninstall_app' tool, registered in the ListTools response.
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 registers and dispatches calls to the uninstallApp method in AppTools.
case 'adb_uninstall_app': return await this.handleToolCall(this.appTools.uninstallApp(args?.packageName as string, args?.deviceId as string));