# snap-o-network-inspector

Adopt this skill: https://proskills.md/skills/other/openai-snap-o-skills-snap-o-network-inspector

Page: https://proskills.md/skills/other/openai-snap-o-skills-snap-o-network-inspector
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: skills/snap-o-network-inspector/SKILL.md
size: 4150
upstream: https://github.com/openai/snap-o/blob/main/skills/snap-o-network-inspector/SKILL.md

````text
---
name: snap-o-network-inspector
description: Inspect Android network captures and intercept HTTP calls with the Snap-O CLI for a selected device/socket. Use for request/response details, websocket events, API response overrides, mock responses, or delays with Python route handlers.
---

# Snap-O Network Tool

Use this skill to inspect network traffic or override API responses in an Android app.

## CLI Path

Use the Network CLI bundled with the Snap-O plugin:

```bash
SNAPO_BIN=/path/to/snap-o/skills/snap-o-network-inspector/scripts/snapo-network
```

Resolve `scripts/snapo-network` relative to the directory containing this `SKILL.md`; do not assume the current working directory. The script requires Python 3 and Android Platform Tools; no Python packages, compiler toolchain, or macOS application are required.

The script resolves `adb` from `PATH`, `ANDROID_SDK_ROOT`, or `ANDROID_HOME`. Use `--adb <path>` or `SNAPO_ADB` to select a specific ADB executable or wrapper. Wrappers selecting a remote ADB server must tunnel Snap-O forwards back to localhost; otherwise, pass both `--adb-host` and `--adb-port`.

Listings use ADB process and package information without contacting the app. JSON rows contain `pid`, `processName`, and `packageName`; unresolved identity fields are `null`. Friendly app labels and icons are not loaded.

## Current Command Surface

- `snapo-network list`: lists available Snap-O Network Tool servers.
- `snapo-network requests`: emits CDP network events for a server.
- `snapo-network show`: shows full details for a request id, including headers and bodies.
- `snapo-network intercept <file.py>`: runs [Python route handlers](references/interception.md) to edit or mock HTTP responses; requires Snap-O OkHttp interception support in the app.

Useful global selectors:

- `-s`, `--serial`: use a specific device serial.
- `-d`: use the single connected USB device.
- `-e`: use the single connected emulator.
- `--adb`: use a specific ADB executable or wrapper.
- `--adb-host`, `--adb-port`: connect directly to an explicit remote ADB server; otherwise the configured ADB command selects its endpoint.

## Inspection Flow

1. List available servers.

```bash
"$SNAPO_BIN" list --json
```

For a remote ADB endpoint, append `--adb-host <host> --adb-port <port>` to `list`, `requests`, `show`, or `intercept`; the script uses the ADB server directly. Otherwise, its localhost forward is removed automatically when the command exits.

Use `--no-app-info` to skip package and process lookup.

2. Pick a target serial and socket. If multiple devices or sockets are available, select them explicitly.

3. Pull captured events.

```bash
"$SNAPO_BIN" requests -s <serial> -n <socket_name> --filter '<url-filter>' --no-stream --json
```

`--filter` uses the same case-insensitive URL syntax as the Network Tool search bar. Separate terms must all match, a term prefixed with `-` is excluded, and quotes or backslashes can escape whitespace.

`snapo-network requests` replaces request `Authorization` and `Cookie` values and response `Set-Cookie` values with `[REDACTED]`.

4. Inspect one request deeply when full request or response details are required.

```bash
"$SNAPO_BIN" show -s <serial> -n <socket_name> -r <request_id> --json
```

This output can contain URL query values and request or response bodies.

5. Re-check command help if output differs.

```bash
"$SNAPO_BIN" --help
"$SNAPO_BIN" list --help
"$SNAPO_BIN" requests --help
"$SNAPO_BIN" show --help
"$SNAPO_BIN" intercept --help
```

## Output Notes

- `--json` emits NDJSON, so process it line by line.
- `snapo-network requests` emits Chrome DevTools Protocol-style records with top-level `method` and `params` fields.
- Use `--no-stream` for a one-shot buffered snapshot.
- `snapo-network intercept` writes runner logs to stderr and does not accept `--json`, `--filter`, or `--no-stream`.
- Network protocol 2 uses a tool-owned `/network/protocol` version check, HTTP history and body reads, and SSE for live events. Interception registers routes with a POST that returns its own SSE connection. The CLI requires an updated Android Network library.
````

## File: README.md
upstream: https://github.com/openai/snap-o/blob/main/README.md

```text
[![Download Snap-O for macOS](https://img.shields.io/github/v/release/openai/snap-o?label=Download%20for%20macOS&color=brightgreen)](https://github.com/openai/snap-o/releases/latest/download/Snap-O.dmg)

<p>
  <img src=".github/banner.webp" width="640" alt="Snap-O: Fast. Focused. Effortless.">
</p>

Snap-O is a handy macOS app for inspecting Android apps. Capture screenshots and recordings, inspect network traffic, override responses, and adjust app values while your app runs.

[Documentation](https://openai.github.io/snap-o/)

## Get started

Requires macOS 26 or later and `adb` from Android Platform Tools.

If you don't already have `adb`, install Android Platform Tools through Android Studio or `brew install android-platform-tools`.

1. [Download Snap-O](https://github.com/openai/snap-o/releases/latest/download/Snap-O.dmg) and move it to Applications.
2. Connect a device with USB debugging enabled, or start an emulator.
3. Open Snap-O. Live Preview starts automatically. Command-drag the preview to share a screenshot, or press `⇧⌘V` to start or stop recording.

Screen capture needs no library in your Android app. Network and Tweaks each require an Android integration; follow the guides below.

For capture controls and keyboard shortcuts, see the [Screen capture guide](docs/screen-capture.md).

## Screen capture

Save screenshots and recordings to Capture History to keep them across app restarts. Open **Window → Capture History** (`⌘Y`) to browse captures by day and reopen them. Each window captures its selected device. Existing groups of captures remain available in history.

Drag screenshots and recordings straight into a pull request, chat, or document. Play recordings immediately and step through them frame by frame to check an animation. Work with multiple devices and keep captures open in separate windows.

History keeps captures for 30 days by default, with a 5 GB storage limit. Change these limits in **History Storage**, or use **Save As…** (`⌘S`) to keep a permanent copy.

[Capture History and storage](docs/screen-capture.md#capture-history)

## Network

Inspect HTTP requests and responses, JSON bodies, Server-Sent Events, and WebSocket messages. Snap-O buffers recent traffic on the device, so you can inspect requests made before you opened the tool.

The Android libraries support OkHttp, Ktor's OkHttp engine, and HttpURLConnection. Python handlers can edit or mock HTTP responses through the app's OkHttp connection.

The Network pane shows registered overrides for the selected app. The list updates when CLI runners start, reload routes, or disconnect. Viewing the list does not change the overrides.

Captured requests show **Overwritten** when a handler changes or mocks their response, and **Watched** when it returns the upstream response unchanged. Open an overwritten request to compare the original response with the response delivered to the app.

[Set up Network](https://openai.github.io/snap-o/network-inspector.html)

## Tweaks

Change values in Compose, Views, and other Kotlin code without rebuilding or restarting your app. Adjust numbers, colors, booleans, strings, enums, and Bézier curves, or run actions registered by the app.

Use `tweaks-core` and `TweakScope` outside Compose. See [Tweaks without Compose](tools/tweaks/android/core/README.md) for setup and ownership examples.

Tweaks are available through the Tool pane, an optional on-device panel, the CLI, and the REST API.

[Set up Tweaks](https://openai.github.io/snap-o/tweaks.html)

## CLI and Codex

Network and Tweaks each have a standalone CLI and a Codex skill for macOS and Linux. They require Python 3, Android Platform Tools, and the matching Android integration. The macOS app does not need to be running.

See the feature guides for CLI setup and links to each skill:

- [Network CLI](docs/network-inspector.md#cli) · [Network skill](docs/network-inspector.md#agents)
- [Tweaks CLI](docs/tweaks.md#cli) · [Tweaks skill](docs/tweaks.md#agents)

## Plugins

Android apps bundle tool plugins that provide tools for inspecting data, changing settings, and running actions. A tool plugin includes its Android implementation and an optional frontend. Snap-O displays the selected tool’s frontend in the Tool pane; the Mac app does not bundle tool frontends. Network and Tweaks use the same extension model as custom tools.

Start with [Build a tool](docs/plugins.md). See [tool development](tools/README.md) for repository commands and host behavior.

## Build from source

Requires Xcode 26.4.1 or later and Android Platform Tools.

1. Clone this repository.
2. Open `app-macos/Snap-O.xcodeproj` in Xcode, then build and run.

Gradle downloads Node.js and npm when building the Android tool frontends. Direct frontend checks still require a local Node installation. See [tool development](tools/README.md).

See [Contributing](CONTRIBUTING.md) for development and signing instructions, and [Release requirements](release/README.md) for release checks.

## Contributing

Snap-O is maintained as time allows, with no formal roadmap. [Bug reports](https://github.com/openai/snap-o/issues) and small patches are welcome. Read the [contribution guide](CONTRIBUTING.md) and [code of conduct](CODE_OF_CONDUCT.md) before contributing.

## License

[Apache 2.0](LICENSE). Copyright 2025 OpenAI.
```
