mobile_list_apps
Retrieve a list of all installed applications on a mobile device for automation or analysis, compatible with iOS and Android via the Mobile Next MCP Server.
Instructions
List all the installed apps on the device
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| noParams | Yes |
Implementation Reference
- src/server.ts:250-261 (registration)Registration of the 'mobile_list_apps' MCP tool, including name, description, input schema, and inline handler function that delegates to robot.listApps().tool( "mobile_list_apps", "List all the installed apps on the device", { device: z.string().describe("The device identifier to use. Use mobile_list_available_devices to find which devices are available to you.") }, async ({ device }) => { const robot = getRobotFromDevice(device); const result = await robot.listApps(); return `Found these apps on device: ${result.map(app => `${app.appName} (${app.packageName})`).join(", ")}`; } );
- src/server.ts:153-179 (helper)Helper function used by the handler to retrieve the platform-specific Robot instance (AndroidRobot, IosRobot, or Simulator) based on the device identifier.const getRobotFromDevice = (device: string): Robot => { const iosManager = new IosManager(); const androidManager = new AndroidDeviceManager(); const simulators = simulatorManager.listBootedSimulators(); const androidDevices = androidManager.getConnectedDevices(); const iosDevices = iosManager.listDevices(); // Check if it's a simulator const simulator = simulators.find(s => s.name === device); if (simulator) { return simulatorManager.getSimulator(device); } // Check if it's an Android device const androidDevice = androidDevices.find(d => d.deviceId === device); if (androidDevice) { return new AndroidRobot(device); } // Check if it's an iOS device const iosDevice = iosDevices.find(d => d.deviceId === device); if (iosDevice) { return new IosRobot(device); } throw new ActionableError(`Device "${device}" not found. Use the mobile_list_available_devices tool to see available devices.`); };
- src/server.ts:256-260 (handler)The core handler logic for the mobile_list_apps tool: fetches the robot and calls listApps(), formats the list of apps.async ({ device }) => { const robot = getRobotFromDevice(device); const result = await robot.listApps(); return `Found these apps on device: ${result.map(app => `${app.appName} (${app.packageName})`).join(", ")}`; }