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​

public byte[] screenshot()
public byte[] screenshot(Path path)

Captures the screen as PNG.

@return the PNG's bytes

Captures the screen as PNG and writes it to a file.

@param path where to write the PNG @return the PNG's bytes

Examples​

Save a screenshot​

byte[] png = device.screenshot(Path.of("screen.png"));

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