Skip to content

Reference

device_snapshot

Manage exact device sessions and capture UI snapshots even when a Dev Client remains at its native picker. 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 snapshots are never strict source evidence. A fresh Expo Developer Menu snapshot includes meta.foregroundSurface plus the exact authority-available meta.recommendation for cdp_dev_settings({ action: “hideDevMenu” }); other or uncertain surfaces never receive that recommendation. action=open starts a session (required before other device_ tools), waits for Android app accessibility, and reports readiness.reactNativeUi=ready only when a matching live CDP helper confirms the RN fiber boundary; otherwise it warns that RN readiness is unverified. Pass deviceId to select an exact iOS simulator UDID or Android adb serial when devices run in parallel. 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); liveness is checked only on the resolved exact device and refuses when that identity is unavailable.

NameTypeRequiredDefaultConstraintsDescription
actionenum: open | close | snapshotNo'snapshot'open: start session for an app. snapshot: capture UI tree with element refs. close: end session.
appIdstringNoApp bundle ID — required for action=open (e.g. “com.example.app”)
platformenum: ios | androidNoTarget platform — used with action=open to select device
deviceIdstringNoExact iOS simulator UDID or Android adb serial to use for action=open
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()