Connecting to a USB Android device in a Docker container via ADB

前端 未结 6 1054
鱼传尺愫
鱼传尺愫 2020-12-04 18:15

I have created a Docker image which contains the Android SDK and am trying to expose my Android phone in a container running this image. So I used the --privileged

6条回答
  •  情深已故
    2020-12-04 18:48

    Running with just --privileged -v /dev/bus/usb:/dev/bus/usb did not work for me. I tried forwarding the adb daemon's listening port using -p 5037:5037, but that did not help either.

    It worked only after I added --net host. This means the host machine's net interfaces are exposed to the docker so use it if you are fine with that. Maybe there are more ports that needed to be forwarded other than 5037....

提交回复
热议问题