Skip to content

Reference

device_screenshot

Capture the exact authority-bound device screen with no cross-device retry. Raw control requires exact install/device/runner authority but not a managed Metro target; meta.originAuthority explicitly reports proven or not-proven, and not-proven screenshots are never strict source evidence. Returns the file path; iOS failures preserve sanitized backend argv, exit/signal/timeout, stderr, output format/path, and a shortened receipt-bound device identity.

NameTypeRequiredDefaultConstraintsDescription
pathstringNoOutput file path (default: auto-generated in /tmp). Use .jpg extension for JPEG.
formatenum: jpeg | pngNoImage format (default: auto-detect from path extension, or jpeg)
platformenum: ios | androidNoAuthority-bound platform; conflicting values are refused
deviceIdstringNoAuthority-bound exact device identifier; normally injected by the session
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()