listDeviceImages
Retrieve all available device images for Android or iOS platforms using AutoMobile's MCP server to support mobile automation testing and device management.
Instructions
List all available device images for the specified platform
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| platform | Yes | Target platform |
Implementation Reference
- src/server/deviceTools.ts:88-103 (handler)The handler function that implements the core logic of the 'listDeviceImages' MCP tool. It creates a DeviceUtils instance and calls listDeviceImages on it, then formats the response.const listDeviceImagesHandler = async (args: listDeviceImagesArgs) => { try { const deviceUtils = new DeviceUtils(); const imageList = await deviceUtils.listDeviceImages(args.platform); return createJSONToolResponse({ message: `Found ${imageList.length} available ${args.platform} AVDs`, images: imageList, count: imageList.length, platform: args.platform }); } catch (error) { throw new ActionableError(`Failed to list ${args.platform} AVDs: ${error}`); } };
- src/server/deviceTools.ts:8-10 (schema)Zod schema defining the input parameters for the listDeviceImages tool, requiring a 'platform' field.export const listDeviceImagesSchema = z.object({ platform: z.enum(["android", "ios"]).describe("Target platform") });
- src/server/deviceTools.ts:159-164 (registration)Registration of the listDeviceImages tool with the ToolRegistry, including name, description, schema, and handler.ToolRegistry.register( "listDeviceImages", "List all available device images for the specified platform", listDeviceImagesSchema, listDeviceImagesHandler );
- src/utils/deviceUtils.ts:32-43 (helper)Supporting method in DeviceUtils class that delegates device image listing to platform-specific utilities (emulator for Android, simctl for iOS).async listDeviceImages(platform: SomePlatform): Promise<DeviceInfo[]> { switch (platform) { case "android": return this.emulator.listAvds(); case "ios": return this.simctl.listSimulatorImages(); case "either": const emulators = await this.emulator.listAvds(); const simulators = await this.simctl.listSimulatorImages(); return [...emulators, ...simulators]; } }