Native support for Android TV / Android devices


Little update : works just fine !


How do I suppress this in my log?

08-01-2019:14:18:50,270 DEBUG    [] Connect to adb server -
08-01-2019:14:18:50,270 DEBUG    [] b'0027host-serial:'
08-01-2019:14:18:50,271 DEBUG    [] Connection closed...
08-01-2019:14:18:50,272 DEBUG    [] Connect to adb server -
08-01-2019:14:18:50,272 DEBUG    [] Connect to adb server -
08-01-2019:14:18:50,273 DEBUG    [] b'0027host-serial:'
08-01-2019:14:18:50,273 DEBUG    [] Connection closed...
08-01-2019:14:18:50,274 DEBUG    [] Connect to adb server -
08-01-2019:14:18:50,274 DEBUG    [] Connect to adb server -
08-01-2019:14:18:50,275 DEBUG    [] b'001Dhost:transport:'
08-01-2019:14:18:50,276 DEBUG    [] b'002Ashell:dumpsys power | grep "Display Power"'
08-01-2019:14:18:50,571 DEBUG    [] Connection closed...


Cool, how does one do this? Running hassio ion a rpi3 at the moment!

Step-by-step :slight_smile:

  • Install the “Portainer” add-on from the “Community Add-Ons”.
  • Configure and start the add-on.
  • Open Portainer (http://ip-of-hassio:9000) and add a new container with the settings like my sreenshot :

  • Press “Deploy the container” to create the container. This may take a while so wait for the process to complete.
  • When the deploy is ready connect to the shell of the new container, see screenshots :


  • When connected to the console enter the following commands :

    apt-get update
    apt-get install android-tools-adb
    adb -a nodaemon server &
    adb connect _ip-of-androidtv_

    After entering the adb connect command you should get a popup on your androidtv to trust the connection.

  • You now should be able to use the component with the following settings in your configuration.yaml :

     - platform: androidtv
       host: ip-of-androidtv
       name: AndroidTV   

I didn’t test what happens when you restart the container. To make this fool proof you can add a startup script to the raspbian installation to start the adb server.


Thanks for your awesome instructions! :+1:
I think adding a crontab to connect to the device on restart, and also keep connecting to it, like every 10min would make a great addons.


Following what @hvdheurik did, I think this ADB server addon works now. Please test it and let me know!


First of all, love the idea of the add-on ! Makes it much easier to install. After starting the add-on the following error appaers in the log and the add-on stops :

/ line 9: 10 Segmentation fault (core dumped) adb -a nodaemon server


That’s odd, I definitely didn’t get that error. Did you stop your other container?


Hi @JeffLIrion, this add-on is a great idea!!

I installed the add-on, but I receive the same error:

/ line 9: 10 Segmentation fault (core dumped) adb -a nodaemon server

I’m running hassio on a Intel NUC


@hvdheurik and @matisaul, I replaced adb -a nodaemon server with adb start-server. I uninstalled and then reinstalled the addon, but now it won’t start for me. I’m not sure what the problem is :thinking:


Yes, i stopped my container but maybe it has something to do with the port (5037) being in use.


Same problem here how to suppress this log spamming? Thanks

my config:

  • Home assistant manual installation on debian in a virtual env

  • in configuration.yaml:


    default: warn


So whars the status on this. Does it work ie should one test or is it not working at all currently?


I need help getting it to work. If you think you could fix it, then please give it a shot!


sorry … what’s the syntax to open an applicatio?n (for example, Kodi, Netflix, Plex …)

{ “entity_id” :“media_player.mibox3”, “intent”: “xxxxxxxx” }


If I had the knowhow I would! I appreciate your effort, hopefully it will get solved.

#77 ADB server addon ( ) failed to install with the following error

ERROR (SyncWorker_17) [hassio.docker.addon] Can’t build a77d3ee3/amd64-addon-adb_server:0.1: The command ‘/bin/sh -c apt-get update && apt-get install -y jq android-tools-adb’ returned a non-zero code: 100


Yeah, it doesn’t work…:frowning_face:

My next idea is to build from the hassioaddons/ubuntu-base-* images, using the aircast addon as a template.


So I managed to get this working somewhat to my surprise!

My setup is running in a VM that sits on unRAID. My Docker understanding is pretty limited to unRAID where i have a number of containers running.

I deployed the Docker container sorccu/adb to unRAID with the following settings

Network Type: Host
Privileged: Yes
Container Port: 5037
Container Path: /opt/platform-tools

I then extracted the latest platform-tools into the local path that was mapped to /opt/platform-tools, In my limited experience i had assumed the docker image would create these files, but aside from a small permissions change it seamed to work fine me manually supplying the platform-tools files.

I added the following to my media_player.yaml, pointing adb_server_ip to my unRAID servers IP

- platform: androidtv
  name: MiBox3

and finally enabled USB / WiFi debugging on the Mi Box (had to connect it to USB before running adb tcpip 5555)

Will report back after using the addon for a while.


That’s what I am doing. But you will find that after some amount of sleep, the ADB connection drops and then this component breaks. I created a cron job to execute adb connect every few minutes to force it to reconnect when the Mi Box wakes up again.