Skip to main content
Glama

adb_list_apps

Retrieve a list of installed apps on an Android device via Android Debug Bridge (ADB) by specifying the device ID. Useful for remote app management and automation.

Instructions

List installed apps on the device

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceIdNoDevice ID (optional)

Implementation Reference

  • The handler function listInstalledApps that executes the ADB command 'shell pm list packages -3' to list third-party installed apps, parses the package names, and returns structured data including success status, list of packages, count, and device ID.
    async listInstalledApps(deviceId?: string) { try { const connected = await this.adbClient.isDeviceConnected(deviceId); if (!connected) { return { success: false, error: 'Device not connected', message: 'Cannot list apps - device is not connected' }; } const command = 'shell pm list packages -3'; const result = await this.adbClient.executeCommand(command, deviceId); if (!result.success) { return { success: false, error: result.error, message: 'Failed to list installed apps' }; } const packages = result.output .split('\n') .map(line => line.replace('package:', '').trim()) .filter(line => line.length > 0); return { success: true, data: { packages, count: packages.length, deviceId: deviceId || this.adbClient.getDefaultDevice() }, message: `Found ${packages.length} installed apps` }; } catch (error: any) { return { success: false, error: error.message, message: 'Failed to list installed apps' }; } }
  • The input schema definition for the adb_list_apps tool, specifying an optional deviceId parameter.
    name: 'adb_list_apps', description: 'List installed apps on the device', inputSchema: { type: 'object', properties: { deviceId: { type: 'string', description: 'Device ID (optional)', }, }, required: [], },
  • src/index.ts:461-462 (registration)
    The switch case registration that dispatches calls to adb_list_apps to the AppTools.listInstalledApps method.
    case 'adb_list_apps': return await this.handleToolCall(this.appTools.listInstalledApps(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