I am unable to find any API references for building remote apps for Android TV. However, considering there are multiple third party apps on the Play store which can control Android TVs, I was wondering if it is possible to do the same from Linux on Raspberry Pi.

  • Something like this ? github project – Ephemeral Jan 9 '20 at 14:50
  • 1
    Not Pi specific. If Linux can do it then the Pi can do it. – joan Jan 9 '20 at 15:49
  • If the android tv has a webinterface you can probably use it via http requests – Sim Son Jan 9 '20 at 18:08

Of course yes. You can connect to Android TV via ADB. Next, send the commands to the ADB mode of the TV.

Connect to the TV:

- Install ADB package on the Raspberry Pi:

sudo apt-get update  
sudo apt-get install adb

- Turn on ADB on the TV and find the TV's IP address then try to connect as port 5555. Assume that the IP address of the TV is

adb connect  

- Accept on the TV, a dialog like picture below:

enter image description here

Now, you've connected to the TV and also can run any ADB commands according to your TV brand.

You need to just find ADB commands for changing the channel, input, brightness level, etc as reported by your TV brand's RCKey.

ADB Commands:

With the help of this link - Darren's AndroidTV Automation Framework, you would be able to change states of the TV as I said above. It will help you enough and you might not need more information.

To find your TV's RCKey, check this link - Hacking an Android TV out.

If you are familiar with java, read this link - Android TV KeyEvent to create your own framework!

Overall, with the help of the ADB connection, you can achieve the goal that you said.

  • Thanks, I'll look this up. One question though, does this ADB connection work over wi-fi? Or I'll have to first connect using USB? – gouravkr Jan 11 '20 at 3:20
  • @gouravkr If you are asking in general, Android OS on smartphones, you must connect it by USB cable but Android TV is different. You are able to connect it without any USB connection. Just enable ADB on the TV. – M. Rostami Jan 11 '20 at 10:17
  • Thanks a lot. I'll try it out. – gouravkr Jan 12 '20 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.