This is a pretty basic overview on how to setup the Android TV emulator to sort of work like a TV device if you are testing a UI.
First we are going to assume that you want to emulate basic controls like on a simple remote e.g. with up/down/left/right, back and menu. Emulating a more advanced remote will be the subject of a more detailed post.
First you are going to need Android Developer Tools installed. And then you need to open the Android Virtual Device Manager.
Steps to achieve this setup are as per the following video:
Essentially what we are doing here is:
- Creating an essentially blank AVD based on a 4.2.2 operating system image
- Setting it so the hardware dpad is enabled, as this is what we will use for basic remote emulation
- Setting it so that the hardware keys (menu, back) are enabled
Details of my config.ini are here:
hw.device.name=4.65in 720p (Galaxy Nexus)
Accessing a network service on the device can be done with a bit of extra setup. The following example shows how we would access a service running over http on the emulator on port 6999
- Telnet to the port of the device, e.g. telnet localhost 5554
- Type: redir add tcp:5010:6999
- You can now access http://localhost:5010/remote the same as if it was running on the device that was available on the local network