When building a Google TV application, it's important that you always test your application on a real device before releasing it to users. This page describes how to set up your development environment and Google TV device for testing and debugging on the device. The tools included in the Android SDK make it easy to install and run your application on the device each time you compile. You can install your application on the device directly from Eclipse or from the command line with ADB.
Setting up a Device for Development
- Find your workstation's IP address and write it down. The procedure varies according to the platform you're using. You will use this information to configure your Google TV device for development.
- On your Google TV device, on the Home screen, click the All Apps icon to view all Android applications, then click the Settings icon to see the settings.
- In the Settings application, select Applications > Development.
- Set Remote debugging to allow your workstation to connect to this device.
- Click Debugger IP address, then in the dialog enter your workstation's IP address and click Set.
Connecting to the Device
You can't connect to a Google TV device over USB from your workstation, but you can use an IP connection. You can use ADB (Android Debug Bridge) for this.
To connect ADB to Google TV with IP:
- On the Home screen of your Google TV device, click the All Apps icon to view all Android applications, then click the Settings icon to see the settings.
- In the Settings application, select Network > Status. Under IP address, find the IP address listed for your Google TV device and write it down.
Use ADB to connect to your Google TV device from your development workstation. To do this, on your development workstation open a terminal session
or command prompt and run the ADB tool:
$ /<SDKpath>/platform-tools/adb connect <IPAddress>
<SDKpath>is the path to your Android SDK, and
<IPAddress>is the IP address of your Google TV device.
To test the connection, enter the command:
$ adb devices
You should see the following output:
List of devices attached <IPAddress>:5555 device
Keep in mind when using DDMS to create a screenshot from a Google TV device, any "Video Playback" area in your application will appear blacked out. This is a known system limitation.