tracer0tong / android-emulator

Yet another Docker container with Android SDK and Android emulator
Apache License 2.0
246 stars 95 forks source link

Cannot `adb connect` from windows host #32

Open emragins opened 6 years ago

emragins commented 6 years ago

I'm having issues connecting to the devices from a windows host when the docker machine is running. Using the new linux subsystem in windows (ubuntu flavored) I can ssh in fine and poke around. I just don't know why it's complaining. The adb tools are on the windows host. Just for kicks and giggles though I tried to use the same tools through the linux subsystem and got similar results. I'm at a loss.

the running container

> docker ps
5972aa2fe34        tracer0tong/android-emulator   "/entrypoint.sh"    31 minutes ago      Up 31 minutes
       0.0.0.0:32774->22/tcp, 0.0.0.0:32773->80/tcp, 0.0.0.0:32772->443/tcp, 0.0.0.0:32771->5037/tcp, 
0.0.0.0:32770->5554/tcp, 0.0.0.0:32769->5555/tcp, 0.0.0.0:32768->5900/tcp   android

adb connect using 0.0.0.0

> adb kill-server
> adb connect 0.0.0.0:32769
* daemon not running; starting now at tcp:5037
* daemon started successfully
unable to connect to 0.0.0.0:32769: cannot connect to 0.0.0.0:32769: The requested address is not 
valid in its context. (10049)

adb connect using IpAddress

> docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' android
172.17.0.2
> adb kill-server
> adb connect 172.17.0.2:32769
* daemon not running; starting now at tcp:5037
* daemon started successfully
unable to connect to 172.17.0.2:32769: cannot connect to 172.17.0.2:32769: A connection attempt 
failed because the connected party did not properly respond after a period of time, or established 
connection failed because connected host has failed to respond. (10060)

A trimmed netstat -a

 Proto  Local Address          Foreign Address        State
  TCP    0.0.0.0:80             IVYSAUR:0              LISTENING
  TCP    0.0.0.0:135            IVYSAUR:0              LISTENING
  TCP    0.0.0.0:445            IVYSAUR:0              LISTENING
  TCP    0.0.0.0:1536           IVYSAUR:0              LISTENING
  TCP    0.0.0.0:1537           IVYSAUR:0              LISTENING
  TCP    0.0.0.0:1538           IVYSAUR:0              LISTENING
  TCP    0.0.0.0:1539           IVYSAUR:0              LISTENING
  TCP    0.0.0.0:1540           IVYSAUR:0              LISTENING
  TCP    0.0.0.0:1544           IVYSAUR:0              LISTENING
  TCP    0.0.0.0:1546           IVYSAUR:0              LISTENING
  TCP    0.0.0.0:1641           IVYSAUR:0              LISTENING
  TCP    0.0.0.0:2179           IVYSAUR:0              LISTENING
  TCP    0.0.0.0:8080           IVYSAUR:0              LISTENING
  TCP    0.0.0.0:32768          IVYSAUR:0              LISTENING
  TCP    0.0.0.0:32769          IVYSAUR:0              LISTENING
  TCP    0.0.0.0:32770          IVYSAUR:0              LISTENING
  TCP    0.0.0.0:32771          IVYSAUR:0              LISTENING
  TCP    0.0.0.0:32772          IVYSAUR:0              LISTENING
  TCP    0.0.0.0:32773          IVYSAUR:0              LISTENING
  TCP    0.0.0.0:32774          IVYSAUR:0              LISTENING
  TCP    0.0.0.0:46708          IVYSAUR:0              LISTENING
  TCP    0.0.0.0:57621          IVYSAUR:0              LISTENING
.
.
.
  TCP    127.0.0.1:22223        IVYSAUR:0              LISTENING
  TCP    127.0.0.1:32774        IVYSAUR:57088          ESTABLISHED  ### My SSH session
  TCP    127.0.0.1:44430        IVYSAUR:0              LISTENING
.
.
.

I've been banging my head against the wall for quite some time now and any help towards getting adb to connect would be appreciated.

sakshambahati05 commented 6 years ago

I too am facing similar issue ! Can no one respond to it ! :-(

C:\AndroidSDK\platform-tools>adb connect 10.149.242.37:5555 unable to connect to 10.149.242.37:5555: cannot connect to 10.149.242.37:5555: A connection attempt failed because the connected party did not properly respond after a period of time, or establish ed connection failed because connected host has failed to respond. (10060)

ftokc commented 6 years ago

Anyone listening? Sorry. I'm in the wrong forum. Please, kindly disregard. I will try to delete my previous comment. Thanks, Frank

tracer0tong commented 6 years ago

Guys, I'm not actively supporting project now. Best thing that you can do is pull request. Many people using that container as a template, you can help them a lot.

amiralam0 commented 2 years ago

i got this error too

tracer0tong commented 2 years ago

But still, my recommendation is try to debug and fix that issue with pull-request. Sorry that I can't help too much.