Skip to main content

screenshot

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Capture the device screen as a PNG. These call app_screenshot.

screenshot​

def screenshot(path: str | None=None) -> bytes

Capture the screen as PNG, optionally also writing it to path.

Examples​

Save a screenshot​

png = device.screenshot("screen.png")
print(len(png), "bytes")

The same call from the command line, mobium screenshot -o screen.png, printed on an Android 15 emulator:

saved …/screen.png (153875 bytes)

mobium screenshot -o screen.png on an Android 15 emulator

mobium screenshot -o screen.png on an Android 15 emulator