budtmo / docker-android

Android in docker solution with noVNC supported and video recording
Other
9.43k stars 1.25k forks source link

[🐛 Bug ]: Emulator not starting #454

Open Bebrevski opened 3 weeks ago

Bebrevski commented 3 weeks ago

Operating System

Ubuntu

Docker Image

budtmo/docker-android:emulator_14.0

Expected behaviour

Run command and get booted emulator

          docker run -d --privileged -p 6080:6080 -p 5555:5555 -p 5554:5554 -e EMULATOR_DEVICE=samsung_galaxy_s10_14.0 -e WEB_VNC=true --device /dev/kvm --name android-container budtmo/docker-android:emulator_14.0
          docker ps
          adb kill-server
          adb devices
          sleep 30 && adb connect localhost:5555

Guys, no matter what i do I always get the same result. Just can't find/connect the emulator. I am trying to run it for e2e Detox test on Codemagic platform. I will really appreciate any help and advices i can get.

Keep in mind that this "emulator-5554" might be the Codemagic preinstalled emulator. It is android 11 (very old), so i can't use it. If i try command like docker exec -it android-container adb devices i get an empty list of devices.

Actual behaviour

Just can't find/connect to emulator no matter what i do

Logs

e40c4e9b277cd5857ec28fa583bbfbb6bf3d1900b8e9abdc50229b10d239142d
CONTAINER ID   IMAGE                                 COMMAND                  CREATED         STATUS                  PORTS                                                                                                                                    NAMES
e40c4e9b277c   budtmo/docker-android:emulator_14.0   "/home/androidusr/do…"   5 seconds ago   Up Less than a second   4723/tcp, 0.0.0.0:5554-5555->5554-5555/tcp, :::5554-5555->5554-5555/tcp, 5900/tcp, 9000/tcp, 0.0.0.0:6080->6080/tcp, :::6080->6080/tcp   android-container
cannot connect to daemon at tcp:5037: Connection refused
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
emulator-5554   offline

e40c4e9b277cd5857ec28fa583bbfbb6bf3d1900b8e9abdc50229b10d239142d
CONTAINER ID   IMAGE                                 COMMAND                  CREATED         STATUS                  PORTS                                                                                                                                    NAMES
e40c4e9b277c   budtmo/docker-android:emulator_14.0   "/home/androidusr/do…"   5 seconds ago   Up Less than a second   4723/tcp, 0.0.0.0:5554-5555->5554-5555/tcp, :::5554-5555->5554-5555/tcp, 5900/tcp, 9000/tcp, 0.0.0.0:6080->6080/tcp, :::6080->6080/tcp   android-container
cannot connect to daemon at tcp:5037: Connection refused
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
emulator-5554   offline

failed to connect to localhost:5555
failed to connect to localhost:5555
slavawar commented 2 weeks ago

Hi! Do you have the image available at localhost:6080? What do you see there?

Bebrevski commented 2 weeks ago

Hi! Do you have the image available at localhost:6080? What do you see there?

Hi. I have empty image of "Docker Android" or something like that. I decided to run everything localy on VM and I managed to run the emulator. Now I am trying to figure out why detox tests are timeouting. The whole story is very complicated. The setup and behavior is totally different on the platforms. I guess I need a ton of test for better understanding. As I sad, my goal now is to run everything localy and after that to migrate all to pipeline.

slavawar commented 2 weeks ago

Please note that if you run it on Windows, there will be problems with kvm and therefore image virtualization may not start. There is no such problem on Ubuntu.