Skip to main content

Entertainment OS

The tvlabs connect command connects with Entertainment OS devices, including Sky and Xumo, on the TV Labs platform as if they were in front of you.

Prerequisites​

There are no vendor-specific tools required to connect to an Entertainment OS device. The CLI handles all port forwarding automatically.

To use the debugger, you will need a Chromium or WebKit based browser, such as Safari, Edge, or Chrome. The debugger is not supported by Firefox.

Connecting​

Start an Entertainment OS session on TV Labs and run tvlabs connect. Select the session from the list, and the CLI will establish a connection.

Once connected, the CLI prints the local address of each service on the device:

  • AS REST API at http://localhost:9005, for launching apps, reading settings, and device information
  • AppServiced Gateway at http://localhost:8090, for launching apps and attaching a debugger
  • VNC Remote at http://localhost:5800
  • RFB remote at localhost:5901, for sending key input from a VNC client
  • Debugger at http://localhost:9222/Main.html?ws=localhost:9222/socket/1/1/WebPage

To confirm the connection, open http://localhost:9005/as/system/information in your browser. It returns the device's identity and software version as JSON.

Port Mapping​

The port mapping when tvlabs connect is running and connected to an Entertainment OS session is as follows:

  • Local port 9005 to Entertainment OS device port 9005 (AS REST API)
  • Local port 8090 to Entertainment OS device port 8090 (AppServiced Gateway)
  • Local port 5800 to Entertainment OS device port 5800 (VNC Remote)
  • Local port 5901 to Entertainment OS device port 5900 (RFB remote)
  • Local port 9222 to the WPE Web Inspector (Debugger)
Note

The RFB remote is mapped to local port 5901 because macOS Screen Sharing commonly holds port 5900.

Launching an app​

With tvlabs connect running, open the AppServiced Gateway at http://localhost:8090 in your browser. From the gateway, you can launch any app installed on the device and attach a debugger to it.

You can also launch an app from the command line through the AS REST API. Apps installed on the device are listed at http://localhost:9005/as/apps.

curl -X POST "http://localhost:9005/as/apps/action/launch?appId=com.your.app.id"
Important

Replace com.your.app.id with your application ID.

If your application depends on a locally running web application, you can use tvlabs connect -p <port> to forward a local port to the device. See Accessing a Local Application for more details.

Sideloading builds is not available through tvlabs connect on Entertainment OS. If your testing requires sideloading builds, contact TV Labs support.

Debugging your application​

Entertainment OS runs web apps in WPE, a WebKit port, so the debugger is the WebKit Web Inspector rather than Chrome DevTools.

Launch your application and attach a debugger from the AppServiced Gateway, then open the debugger URL printed by tvlabs connect:

http://localhost:9222/Main.html?ws=localhost:9222/socket/1/1/WebPage

The inspector provides access to the DOM, console, network activity, and more.

Firefox is not supported

The WPE debugger view is not supported by Firefox. Please open the debugger in a Chromium or WebKit based browser, such as Safari, Edge, or Chrome.

The Entertainment OS inspector runs on port 9222 by default, but can be configured by setting the -i argument.

Troubleshooting​

If the debugger page is blank or does not connect, make sure your application is running on the device and that you opened the URL in a Chromium or WebKit based browser.

If the AS REST API answers with errorCode 101 on every path right after the device restarts, wait a minute for its routes to register and try again.

If the ports are not reachable after a successful tvlabs connect, verify that the session is still active on the devices page.

If the device becomes disconnected during the session, press the "r" key in the tvlabs connect UI to reconnect.

If tvlabs connect still cannot make a connection after trying these steps, please contact TV Labs for support.