Skip to content

device_screenshot

Capture a screenshot of the active device screen. Returns the file path. Prefer JPEG for faster capture. When both iOS sim and Android emulator are booted, defaults to the platform of the currently connected CDP target. Output is auto-downscaled to maxWidth (default 800px) via macOS sips to keep LLM context costs predictable; pass maxWidth=0 to disable when full-resolution capture is needed (visual diffing). meta.resize describes what happened. Result may include meta.advisories[] (EPHEMERAL_PATH when saving to /tmp, FULL_RESOLUTION when maxWidth=0) — non-blocking nudges to use docs/proof/<feature>/<NN>-<step>.jpg for deliverables and the default 800px width for everyday captures.

NameTypeRequiredDefaultConstraintsDescription
pathstringNoOutput file path (default: auto-generated in /tmp). Use .jpg extension for JPEG.
format`enum: jpegpng`No
platform`enum: iosandroid`No
maxWidthnumberNomin: 0, integerDownscale image so width does not exceed this many pixels. 0 disables resize. Default 800 (saves ~46% on iPhone 15/17 Pro screenshots without losing label readability).
qualitynumberNomin: 1, max: 100, integerJPEG compression quality (1-100). Only applied to .jpg/.jpeg files. Default 85.
device_screenshot()