Debugger: Attach
debugger_attachOpen a BrightScript debug session on a Roku device, enabling all other debugger tools. Required before any debugger operation; safely reconnects only when no healthy session exists.
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 }.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "debugger_attach"
}
}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. |