Debugger: Attach
debugger_attachAttach a BrightScript debugger session to a Roku device via port 8081, enabling subsequent debugger operations. Safe to call even if already attached.
Instructions
Open a BrightScript debug session to the Roku on control port 8081. REQUIRED FIRST — every other debugger_* tool needs an attached session. Prefer calling the read-only debugger_status before this one: if it already reports attached/running/stopped, skip this call entirely and go straight to the debugger_* operation you need. The port is only open when the channel was launched with debugging (sideload "with Debugging", or a STOP in the source auto-enables it); a plain sideload/relaunch does NOT open it, and attach returns an actionable error explaining that. Safe to call anyway even when already attached: if a healthy session for this device already exists (e.g. the user attached via the app's own debugger UI), this is a no-op that returns success without touching it — it only tears down and reconnects when there is no session, or the existing one is stale/errored (the control port is single-client, so a doomed reconnect would otherwise kill a working session for nothing). On success returns { ip, state }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | No | Optional. Roku IP or serial; must match a connected Dev Studio tab. Omit to use the focused tab. |