> ## Documentation Index
> Fetch the complete documentation index at: https://docs.revyl.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Live observability

> Stream a live session's performance metrics, network requests, and logs from the CLI, or download its report and artifacts afterward.

Revyl captures performance metrics, network requests, and a device trace during every cloud session. You can **stream** these live while a session is running, or **retrieve** them as artifacts after the session completes. This page covers the CLI surface for both.

All commands target the active session by default. Use `-s` to pick a specific one: it accepts either a local index from `revyl device list` or a server-issued session ID from `revyl device start --json`. `--session-id <uuid>` is the explicit spelling of the same thing, and `REVYL_SESSION_ID` scopes a whole shell for the commands that accept `-s`. Prefer session IDs when more than one session is running, because an index only means anything relative to the project directory it was assigned in. See [Device Session Flags](/reference/cli#device-session-flags).

## Live Performance Metrics — `revyl device perf`

Polls CPU%, memory, and (on iOS) FPS from the active session.

```bash
revyl device perf                 # Follow mode: one line per batch, runs until Ctrl-C
revyl device perf --no-follow     # Single snapshot, then exit
revyl device perf --interval 5s   # Change poll interval (default 2s)
revyl device perf --json          # Raw JSON per poll (for piping to jq / files)
revyl device perf -s 0 -f --json  # Target one session by index or ID, follow, JSON
```

Columns adapt to the platform:

| Platform | Columns |
|---|---|
| Android | `TIME  CPU%  RSS  SYS MEM` |
| iOS     | `TIME  CPU%  RSS  FPS` |

Flags:

| Flag | Default | Purpose |
|---|---|---|
| `-f, --follow` | `true` | Poll continuously (send SIGINT to stop). |
| `--no-follow`  | `false` | Take one snapshot and exit. |
| `--interval`   | `2s` | Poll interval (`500ms`, `1s`, `5s`, …). |
| `--json`       | `false` | Emit raw JSON per poll instead of a table. |
| `-s`           | active | Session index or server-issued session ID. |

If the capture pipeline hasn't started yet, the CLI prints `Capture not running, waiting...` and keeps polling.

## Live Network Requests — `revyl device requests`

Streams network requests observed on the device in real time. Each row shows a compact summary (method, status, URL, size, latency).

```bash
revyl device requests                 # Follow mode, compact rows
revyl device requests --no-follow     # Single snapshot
revyl device requests --interval 5s --json
revyl device requests -s 0 -f --json  # Target one session by index or ID, follow, JSON
```

Flags:

| Flag | Default | Purpose |
|---|---|---|
| `-f, --follow` | `true` | Poll continuously. |
| `--no-follow`  | `false` | Take one snapshot and exit. |
| `--interval`   | `2s` | Poll interval. |
| `--json`       | `false` | Raw JSON per poll. |
| `-s`           | active | Session index or server-issued session ID. |

Live request capture has platform prerequisites. If the active session can't produce live requests, the command exits with a clear error. Post-session request data is always available via `device report --artifact network` (below).

## Live Device Logs — `revyl device logs`

Streams captured log records in real time — `logcat` on Android and app-process `OSLog` / `NSLog` on iOS simulators. Revyl-owned instrumentation details are removed from iOS simulator records before persistence; this is not general customer-secret scrubbing. Each entry is printed as a single platform-native line; pipe through `grep` / `rg` to filter.

```bash
revyl device logs                 # Follow mode, one captured log line per entry
revyl device logs --no-follow     # Single snapshot, then exit
revyl device logs --interval 5s --json
revyl device logs -s 0 -f --json  # Target one session by index or ID, follow, JSON
revyl device logs | rg -i "fatal|exception"   # Client-side filter via rg
```

Flags:

| Flag | Default | Purpose |
|---|---|---|
| `-f, --follow` | `true` | Poll continuously (send SIGINT to stop). |
| `--no-follow`  | `false` | Take one snapshot and exit. |
| `--interval`   | `2s` | Poll interval. |
| `--json`       | `false` | Emit raw JSON per poll (includes `next_cursor`, `capture_running`, and `items`). |
| `-s`           | active | Session index or server-issued session ID. |

If the capture pipeline hasn't started yet, the CLI prints `Capture not running, waiting...` and keeps polling. Post-session logs are also included in the full `device report` output.

## Session Report & Artifacts — `revyl device report`

Fetches the stored report for a session and, optionally, individual capture artifacts.

```bash
revyl device report                                    # Active session, full report
revyl device report --session-id <uuid>                # Specific session by ID
revyl device report --session-id <uuid> --json         # JSON (for scripts)

# Artifact URLs
revyl device report --artifact perf                    # Print perf artifact URL
revyl device report --artifact network                 # Print network artifact URL
revyl device report --artifact trace                   # Print trace artifact URL

# Download an artifact to disk
revyl device report --artifact network --download                      # Default filename
revyl device report --artifact perf --download --output perf.json      # Custom path
```

Flags:

| Flag | Purpose |
|---|---|
| `--session-id <uuid>` | Fetch by session ID without having to attach first. |
| `-s <index\|uuid>` | Same selection as `--session-id` when given a session ID; a local index also works. |
| `--artifact perf\|network\|trace` | Select an artifact instead of the whole report. |
| `--download` | Download the selected artifact. Requires `--artifact`. |
| `--output <path>` | Destination path for `--download` (defaults to a sensible filename). Requires `--download`. |
| `--json` | Emit JSON instead of the human-readable summary. |

The artifact flags are mutually required: `--download` and `--output` need `--artifact`, and `--output` needs `--download`.

## Named Device Presets — `revyl device start --device-name`

Start a session using a named preset instead of specifying model + OS version directly. Presets currently include `revyl-android-phone` and `revyl-ios-iphone`.

```bash
revyl device start --device-name revyl-ios-iphone
revyl device start --device-name revyl-android-phone --open
```

Presets are an alternative to `--device-model` + `--os-version`. Use `revyl device targets` to see the full catalog of available models and OS versions.

## Related

- `revyl device list` / `revyl device use <index>` — manage multiple sessions.
- `revyl device info --json` — includes the live WebRTC stream URL (`whep_url`).
- [Device Quickstart](/devices) — end-to-end walkthrough of a cloud session.
- [Troubleshooting](/devices/troubleshooting) — what to do when capture, grounding, or sessions misbehave.
