Skip to content

feat: add save screenshot to disk for iOS device#3

Merged
mlikasam-askui merged 1 commit intomainfrom
feat/ios-save-screenshot-to-disk
Mar 17, 2026
Merged

feat: add save screenshot to disk for iOS device#3
mlikasam-askui merged 1 commit intomainfrom
feat/ios-save-screenshot-to-disk

Conversation

@mlikasam-askui
Copy link
Copy Markdown
Collaborator

Summary

Adds the ability to save a device screenshot directly to a file on disk via a new MCP tool and a new IOSDevice method.

Changes

  • IOSDevice.save_screenshot_to_disk(absolute_image_path) (in ios_device.py):
    • Takes a path (str or Path); resolves to an absolute path.
    • Requires path to end with .png.
    • Fails if the file already exists (no overwrite).
    • Ensures device is booted before any I/O; creates parent directories as needed; takes screenshot and saves as PNG.
  • MCP tool ios_save_screenshot_to_disk(absolute_image_path: str) (in server.py):
    • Calls the selected device’s save_screenshot_to_disk and returns a confirmation message.
    • Docstring clarifies .png requirement, parent-dir creation, and no-overwrite behavior.

Rationale

Enables workflows that need screenshots persisted to a known path (e.g. for reports, debugging, or downstream tools) without going through the in-memory screenshot tool and manual file handling.

@mlikasam-askui mlikasam-askui self-assigned this Mar 17, 2026
@mlikasam-askui mlikasam-askui merged commit 5673a03 into main Mar 17, 2026
1 check failed
@mlikasam-askui mlikasam-askui deleted the feat/ios-save-screenshot-to-disk branch March 17, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant