mobile_save_screenshot
Capture and save a screenshot from a mobile device to a specified file path using a platform-agnostic automation server for iOS and Android applications.
Instructions
Save a screenshot of the mobile device to a file
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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. The handler requires a previously selected device/robot, fetches the screenshot buffer via robot.getScreenshot(), and writes it to the specified file path using Node.js 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:390-396 (handler)The core handler function for 'mobile_save_screenshot' that executes the tool logic: ensures a robot/device is selected, captures the screenshot, saves to file, and returns confirmation.async ({ saveTo }) => { requireRobot(); const screenshot = await robot!.getScreenshot(); fs.writeFileSync(saveTo, screenshot); return `Screenshot saved to: ${saveTo}`; }
- src/server.ts:387-389 (schema)Zod schema for 'mobile_save_screenshot' tool input: requires 'saveTo' string parameter specifying the file path.{ saveTo: z.string().describe("The path to save the screenshot to"), },