Debugging & Profiling
Use agent-device when the task moves past UI automation and you need runtime evidence from the app or device layer.
What agent-device covers well
- Session app logs for targeted debugging windows
- Network inspection from recent HTTP(s) entries in app logs via
network dump - Performance snapshots with
perf/metrics - Screenshots, recordings, and replayable repro flows
React Native component internals
If the task needs the React Native component tree, props, state, hooks, or render profiling, use the react-devtools passthrough:
agent-device remains centered on the device and app runtime layer. The react-devtools command dynamically runs pinned agent-react-devtools commands for React internals.
Fast path
Use this flow when you need a clean repro window with logs, recent network activity, and a quick perf sample from the active app session.
Core commands
Logs
- Logging is off by default; enable it only for focused debugging windows.
- Prefer
logs clear --restartfor clean repro loops. - Use
logs pathand then grep the file instead of loading whole logs into agent context.
Network inspection
network dumpparses recent HTTP(s) entries from the session app log.network logis an alias fornetwork dump.- Parsed results depend on what the app emits into the platform log backend.
Performance snapshots
perfreturns session-scoped startup and, where supported, CPU, memory, and Android frame-health samples.- Startup is measured around the
opencommand; it is not first-frame instrumentation. - CPU, memory, and Android frame-health availability depend on platform and whether the active session is bound to an app/package.
- On Android, use
metrics.fps.droppedFramePercentfor the health check andmetrics.fps.worstWindowsto line up jank clusters with logs, network activity, or recent actions.
Where to go deeper
- Full command reference: Commands
- Typed client observability APIs: Typed Client
- Session behavior and lifecycle: Sessions
