Skip to content

Reference

device_snapshot

Manage device sessions and capture UI snapshots. action=open starts a session (required before other device_ tools). action=snapshot returns the accessibility tree with @ref identifiers for device_press/device_fill. action=close ends the session. Use attachOnly=true on action=open to skip launching the app when it is already running (avoids relaunch-induced bundle races).

NameTypeRequiredDefaultConstraintsDescription
actionunknownNo'snapshot'
appIdunknownNoApp bundle ID — required for action=open (e.g. “com.example.app”)
platformunknownNoTarget platform — used with action=open to select device
sessionNamestringNoSession name override (default: auto-generated)
attachOnlyunknownNo
device_snapshot()