tracer0tong / android-emulator

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

question in connect to vnc #24

Open jaassoon opened 7 years ago

jaassoon commented 7 years ago

when I try to connect android with VNC in port tcp/5900, I just connect to the mac itself, not the android in docker, why?

tracer0tong commented 7 years ago

@jaassoon how are you running Docker in MacOS? Probably in dedicated VM?

jaassoon commented 7 years ago

now I even cant see the devices. docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 278f63e28d8b tracer0tong/android-emulator "/entrypoint.sh" 19 hours ago Up About an hour 0.0.0.0:32777->22/tcp, 0.0.0.0:32776->5037/tcp, 0.0.0.0:32775->5554/tcp, 0.0.0.0:32774->5555/tcp, 0.0.0.0:32773->5900/tcp android adb connect 0.0.0.0:32776 connected to 0.0.0.0:32776 adb devices List of devices attached nothing to show

tracer0tong commented 7 years ago

Could you make netstat -an | grep 32773 in shell? This is a port there are VNC should be attached. And also for 32777 (this is container ssh).

jaassoon commented 7 years ago

netstat -an | grep 32773 tcp6 0 0 ::1.32773 *.* LISTEN tcp4 0 0 *.32773 *.* LISTEN netstat -an | grep 32777 tcp6 0 0 ::1.32777 *.* LISTEN tcp4 0 0 *.32777 *.* LISTEN

jaassoon commented 7 years ago

ok,It can connect to vnc. but adb devices still show nothing

jaassoon commented 7 years ago

And it sounds like I cant do anything with mouse click

jaassoon commented 7 years ago

I use chrome VNC plugin

tracer0tong commented 7 years ago

Two problems here: 1) VNC in Android QEMU is not fully functional. So, it doesn't support mouse clicks and many other features. One option, which was discussed in previous issues to use Monkey Runner to send commands and capture screenshots. 2) About ADB probably you have not connected to correct port. Should be 32774

zoutepopcorn commented 6 years ago

I was able to connect with https://github.com/novnc/noVNC

For adb this worked for me: ''' adb connect 172.17.0.2 '''

baalarazor commented 4 years ago

@zoutepopcorn - Can you help me, how to open emulator in the browser and which url should be given in appium driver?

zoutepopcorn commented 4 years ago

@baalalazor

I don't know what I was doing at that time 🧐 Just try to look at some noVnc installs..

I now use scrcpy, maybe also an option

https://github.com/Genymobile/scrcpy