> For the complete documentation index, see [llms.txt](https://docs.orchard.airoverflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.orchard.airoverflow.com/cli/driving-a-device/frida.md).

# frida: scripts and logs

Manage frida-server and run frida scripts on a device. Every verb takes a sandbox selector (uuid / uuid-prefix / name / tag). These commands use the `frida` capability.

## Check and control the server

```bash
orchard frida status  my-pixel        # show frida-server state
orchard frida install my-pixel        # install frida-server, then start it (slow)
orchard frida start   my-pixel
orchard frida stop    my-pixel
```

`status` shows the frida-server state: installed or not, running or not, the version, and the port. `install` is slow, because it downloads packages.

## Run a script

`inject` runs a frida script against a process. It prints the script output, which is the `send()` and `console.log` calls from the script. Pass a path to a `.js` file, or `-` to read the script from standard input. Name the target process with `--process`. Set the run time with `--timeout` (1 to 30 seconds, default 6). `inject` works on Android devices.

```bash
orchard frida inject my-pixel hooks/log.js --process com.example.app
orchard frida inject my-pixel hooks/log.js -p com.example.app --timeout 15
cat hooks/log.js | orchard frida inject my-pixel - -p com.example.app
```

## Stream a script live

`inject` prints the output once, after the run. `stream` prints each message as the script produces it. It keeps the frida session attached until you stop it with Ctrl-C. Set `--timeout 0` to stream until Ctrl-C (this is the default). `stream` works on Android devices.

```bash
orchard frida stream my-pixel hooks/trace.js --process com.example.app
cat hooks/trace.js | orchard frida stream my-pixel - -p com.example.app
orchard frida stream my-pixel hooks/trace.js -p com.example.app --timeout 30
```

Each line is one frida message: a `send()` payload, a `console.log` line, a script error, or an `orchard` status note. Add `--json` for one JSON object per line.

## Verify frida works

```bash
orchard frida verify my-pixel                    # pick a busy process
orchard frida verify my-pixel --process SpringBoard
```

`verify` attaches to a process and traces it. It proves that frida works.

## Stream device logs

`inject` prints the script output once, after the run. For a live log stream, use the `logs` command. It streams until you stop it with Ctrl-C. Frida `console.log` output on Android also goes to logcat, so it shows in this stream.

```bash
orchard logs my-pixel              # follow the device log
orchard logs my-pixel --no-follow  # print the current buffer and exit
```

Add `--json` to any `frida` command for the raw agent response.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.orchard.airoverflow.com/cli/driving-a-device/frida.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
