Skip to main content

ROKU Apps

Prerequisite: Enable Developer Mode

Before you can run or debug Roku apps, your Roku device must be in developer mode. See Roku Developer Mode Setup.

Running and Debugging Roku Apps

  • Use the [ROKU] launch target in VSCode to transpile, bundle, and deploy your app to the device.
  • Breakpoints are supported in both .ts and .brs files, thanks to Hosanna's source map generation.
  • The BrighterScript plugin provides console output, breakpoint support, and lets you step through code and inspect variables.
  • Enable the Hosanna extension's source sync feature for seamless code updates and debugging.

Logging

  • Use console.log, console.debug, console.error, and console.verbose for logging.
  • Log lines are clickable in the IDE and can be filtered or cleared.
  • For production builds, set logLevel to off in hsconfig-roku.json to strip logs (they remain as comments for readability).

Tips

  • You can run the launch target without transpiling for faster debug cycles.
  • Network requests print curl statements for easy manual testing.
  • Use hs_native_roku(\print foo | stop`)` to inject ad hoc BrightScript code.
  • You can debug via telnet or sideload manually by zipping the src folder.
  • Roku channel zip files must be less than 4MB.
  • The manifest file contains required metadata for Roku releases and can be edited.

Breakpoint Debugging

  • Set breakpoints in VSCode in both TypeScript and BrightScript files.
  • The debugger will pause at breakpoints and exceptions, letting you inspect call stacks and variables.
  • See Native Development Roku for more details.

Chrome DevTools Extension

VSCode Extension

  • Install the Hosanna UI VSCode extension for source mapping, component templates, navigation, and code completion.

Special Launch Query Strings

  • Use query parameters for deeplinking and commands:
    • ?mediaType=movie&contentId=12345 for deeplinking.
    • ?textToSpeech=true to enable text-to-speech.
    • ?mediaType=hosannaCommand&contentId=clearRegistry to clear the registry.

For more details, see: