Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to auto connect devices on container restart #17

Open
mkono87 opened this issue Mar 28, 2019 · 2 comments
Open

How to auto connect devices on container restart #17

mkono87 opened this issue Mar 28, 2019 · 2 comments

Comments

@mkono87
Copy link

mkono87 commented Mar 28, 2019

I set this up on my unraid machine. All my containers shutdown for backups over night so I need a way to have it auto connect again to my devices. Possible?

@ajobbins
Copy link

ajobbins commented Apr 1, 2019

Interested in this too. I am connecting via network, not USB. I have to run 'adb connect 192.168.x.x' after container is started, or it's not connected to my device. I'm hoping this can happen automatically on container start

@mkono87
Copy link
Author

mkono87 commented Apr 1, 2019

@ajobbins
See with this script it connects on startup

#!/bin/sh

sleep 5

DEVICES="192.168.0.206"

echo "Connecting to devices."
for device in $DEVICES; do
   adb connect $device
done
echo "Done."

while true; do
  for device in $DEVICES; do
    adb connect $device > /dev/null 2>&1
  done
  sleep 60
done

When I start he container is auto connects

Connecting to devices.
* daemon not running; starting now at tcp:5037
* daemon started successfully
connected to 192.168.0.206:5555
Done.

But HA is unable to connect to it. So I cant catch a break.

Mon Apr 01 2019 11:29:16 GMT-0400 (Eastern Daylight Time)
Could not connect to mike firetv at 192.168.0.206:5555 using ADB server at 192.168.0.50:5037

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants