mobile_list_apps
Retrieve a list of all installed applications on a device using the Mobile Next MCP server, enabling efficient mobile automation and app management for iOS and Android platforms.
Instructions
List all the installed apps on the device
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| noParams | Yes |
Implementation Reference
- src/server.ts:211-222 (registration)Registration of the 'mobile_list_apps' tool, including input schema (empty), description, and handler function that invokes robot.listApps() and formats the result.tool( "mobile_list_apps", "List all the installed apps on the device", { noParams }, async ({}) => { requireRobot(); const result = await robot!.listApps(); return `Found these apps on device: ${result.map(app => `${app.appName} (${app.packageName})`).join(", ")}`; } );
- src/server.ts:217-221 (handler)The core handler logic for the mobile_list_apps tool, which requires a device/robot to be selected and lists installed apps by calling robot.listApps().async ({}) => { requireRobot(); const result = await robot!.listApps(); return `Found these apps on device: ${result.map(app => `${app.appName} (${app.packageName})`).join(", ")}`; }
- src/robot.ts:10-13 (schema)Type definition (schema) for InstalledApp used in the output of listApps().export interface InstalledApp { packageName: string; appName: string; }
- src/android.ts:93-106 (helper)Android-specific implementation of listApps() using adb to query launcher activities.public async listApps(): Promise<InstalledApp[]> { // only apps that have a launcher activity are returned return this.adb("shell", "cmd", "package", "query-activities", "-a", "android.intent.action.MAIN", "-c", "android.intent.category.LAUNCHER") .toString() .split("\n") .map(line => line.trim()) .filter(line => line.startsWith("packageName=")) .map(line => line.substring("packageName=".length)) .filter((value, index, self) => self.indexOf(value) === index) .map(packageName => ({ packageName, appName: packageName, })); }
- src/ios.ts:125-138 (helper)iOS-specific implementation of listApps() using go-ios library.public async listApps(): Promise<InstalledApp[]> { await this.assertTunnelRunning(); const output = await this.ios("apps", "--all", "--list"); return output .split("\n") .map(line => { const [packageName, appName] = line.split(" "); return { packageName, appName, }; }); }