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
.tsand.brsfiles, 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, andconsole.verbosefor logging. - Log lines are clickable in the IDE and can be filtered or cleared.
- For production builds, set
logLeveltooffinhsconfig-roku.jsonto strip logs (they remain as comments for readability).
Tips
- You can run the launch target without transpiling for faster debug cycles.
- Network requests print
curlstatements 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
srcfolder. - Roku channel zip files must be less than 4MB.
- The
manifestfile 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
- Install the Hosanna DevTools Chrome Extension for advanced debugging, view inspection, state editing, registry management, and more.
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=12345for deeplinking.?textToSpeech=trueto enable text-to-speech.?mediaType=hosannaCommand&contentId=clearRegistryto clear the registry.
For more details, see: