mobile_save_screenshot
Capture and save screenshots from mobile devices for automation testing and debugging purposes. Specify device identifier and file path to store the image.
Instructions
Save a screenshot of the mobile device to a file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | Yes | The device identifier to use. Use mobile_list_available_devices to find which devices are available to you. | |
| saveTo | Yes | The path to save the screenshot to |
Implementation Reference
- src/server.ts:384-397 (registration)Registration of the 'mobile_save_screenshot' tool, including input schema (saveTo path) and inline handler that uses the selected robot to capture and save a screenshot to the specified file path.tool( "mobile_save_screenshot", "Save a screenshot of the mobile device to a file", { saveTo: z.string().describe("The path to save the screenshot to"), }, async ({ saveTo }) => { requireRobot(); const screenshot = await robot!.getScreenshot(); fs.writeFileSync(saveTo, screenshot); return `Screenshot saved to: ${saveTo}`; } );
- src/server.ts:384-397 (handler)The handler function for 'mobile_save_screenshot' is defined inline during registration. It requires a selected robot/device, captures the screenshot buffer via robot.getScreenshot(), and writes it synchronously to the filesystem using fs.writeFileSync.tool( "mobile_save_screenshot", "Save a screenshot of the mobile device to a file", { saveTo: z.string().describe("The path to save the screenshot to"), }, async ({ saveTo }) => { requireRobot(); const screenshot = await robot!.getScreenshot(); fs.writeFileSync(saveTo, screenshot); return `Screenshot saved to: ${saveTo}`; } );
- src/server.ts:388-388 (schema)Input schema for 'mobile_save_screenshot' tool: requires a 'saveTo' string parameter specifying the file path.saveTo: z.string().describe("The path to save the screenshot to"),