Skip to content

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
action`enum: openclosesnapshot`No'snapshot'
appIdstringNoApp bundle ID — required for action=open (e.g. “com.example.app”)
platform`enum: iosandroid`No
sessionNamestringNoSession name override (default: auto-generated)
attachOnlybooleanNoaction=open only: skip launching the app. Requires the app to be already running. Use when connecting to an already-active dev session to avoid bundle-load races.
device_snapshot()