The tvlabs connect
command uses the Android SDK to connect with Android TV devices on the TV Labs platform as if they were in front of you. This includes both Google TV and Fire TV platforms.
Prerequisites
Before starting, please ensure that Android Studio, and adb
command line tool is installed on your system and available in your PATH.
You may install adb
through the Android Studio UI. Go to "Tools" > "SDK Manager", and find the "SDK Tools" tab. Ensure that "Android SDK Command-line Tools" and "Android SDK Platform-Tools" are installed.
Connecting
After Android Studio and adb
are installed, start an Android TV session on TV Labs and run tvlabs connect
.
Once tvlabs connect
has successfully created a vendor connection, run adb devices
to check that the device is connected properly. The Android TV device should appear in the list of devices as 127.0.0.1:5555
.
Port Mapping
The port mapping when tvlabs connect
is running and connected to a Android TV session is as follows:
- Local port 5555 to Android TV device port 5555 (Android Debug Bridge interface)
- Local port 6466 to Android TV device port 6466 (Android TV Remote Control protocol commands)
- Local port 6467 to Android TV device port 6467 (Android TV Remote Control protocol pairing)
Installing
Once connected, you may interact with the Android TV device as if it were on your local network.
Build your application apk locally, and push it to the TV Labs device by running adb install path/to/apk/file.apk
to install the application.
Replace the /path/to/apk/file.apk
portion with the path to your application apk file.
After the application is installed, it can be launched using adb shell am start -n com.example.your.application/.MainActivity
.
Replace the com.example.your.application/.MainActivity
portion with the ID of your application, and the main activity name.
Troubleshooting
If application installation fails, please ensure that the device storage is not full.
If tvlabs connect
fails on the vendor connection, ensure that development mode is enabled on the device.
If when you are first connecting a popup to allow USB debugging appears, please click allow. If this is not allowed, then the device will be unauthorized in the adb devices
list. Select "Allow" on the popup about USB debugging that appears on the device to authorize it.
If tvlabs connect
still cannot make a connection after trying these steps, please contact TV Labs for support.