Nonstop Brightscript SDK

Prerequisites

  1. A Roku Device setup and connected to the same network as your PC
  2. Node 10+

Local Development

  1. Follow the Developer Setup Guide from Roku, noting your Device IP, Device Username and Device Password
  2. In the build folder in the repo, create a file called local-config.js which contains the following:
    exports.deviceIp = '[DEVICE IP FROM STEP 1]';
    exports.deviceUser = '[DEVICE USERNAME FROM STEP 1]';
    exports.devicePassword = '[DEVICE PASSWORD FROM STEP 1]';
  1. From the root of the project, run npm install
  2. From the root of the project, run gulp. This will:
    • Copy the Nonstop SDK files into the demo app
    • Zip the demo app ready for deploy to the Roku device
    • Remove any previously installed versions of the Demo App from the device
    • Install the latest version to the device

Debugging

Learn more about debugging from the Developer Debugging Guide

Enable Telnet

Ensure you have telnet enabled in Windows.

  1. Windows Key
  2. Search for Turn Windows Features on and off
  3. Select
  4. Scroll to Telnet
  5. Ensure Checked

Telnet To Device

  1. Open a console window
  2. Type telnet roku-ip-address 8085

When connected you can use the following commands:

  • brkd - Toggle whether BrightScript should break into the debugger after non-fatal diagnostic messages
  • bsc - Print current BrightScript component instances
  • bscs - Print a summary of BrightScript component instance counts by component type
  • bt - Print backtrace of call function context frames
  • classes - Print BrightScript component classes
  • cont or c - Continue script execution
  • down or d - Move down the, function context chain one
  • exit - Exit shell
  • gc - Run garbage collector
  • help - Print the list of BrightScript console commands
  • last or l - Print the last line that executed
  • list - List current function
  • next or n - Print the next line to execute
  • out - Step out of a function
  • over - Step over a function
  • print, p, or ? - Print a variable or expression
  • step, s, or t - Step one program statement
  • thread <ID> or th <ID> - Select a suspended thread to debug - all following debug commands will execute within that thread
  • threads <ID> or ths <ID> - List all current executed suspended threads
  • up or u - Move up the function context chain one
  • var - Print local variables and their types/values
In this document