sorccu / docker-adb

Dockerfile and instructions for ADB.
Other
200 stars 74 forks source link

adb device empy list #12

Closed thymbahutymba closed 6 years ago

thymbahutymba commented 6 years ago

When i run the command for list adb device the list is empty but running adb device from my computer (without start container) device detected.

~/github $ docker run --rm -ti --net container:adbd sorccu/adb adb devices
List of devices attached

~/github $ adb devices
List of devices attached
ZY3226JH4J      device
sorccu commented 6 years ago

Sounds like either you forgot to mount /dev/bus/usb or your docker runs in a VM that doesn’t see your USB devices (like on Docker for Mac, for example). Nothing we can do about that.

thymbahutymba commented 6 years ago

Sounds like either you forgot to mount /dev/bus/usb

I follow your guide step by step, first i run the following command and after the command in the previous comment. docker run -d --privileged -v /dev/bus/usb:/dev/bus/usb --name adbd sorccu/adb

like on Docker for Mac

I have docker on archlinux. This is the full step that i have perfomed:

~ $ adb devices
List of devices attached
ZY3226JH4J      device

~ $ docker run -d --privileged -v /dev/bus/usb:/dev/bus/usb --name adbd sorccu/adb
dc590b5f75d20c3e2e49cb054da7cfb519e52c84e5d1a179d43ef251d73af123
~ $ docker run --rm -ti --net container:adbd sorccu/adb adb devices
List of devices attached

How can i solve this problem?

sorccu commented 6 years ago

Do you perhaps have normal adb running as well? Run adb kill-server first.

thymbahutymba commented 6 years ago

Yes, of course. I tried to kill and start again but nothing!

marcmerlin commented 5 years ago

If you are plugging your device after the container started, this isn't going to work unless you take extra steps (cgroups and devices.allow). See http://marc.merlins.org/perso/linux/post_2018-12-20_Accessing-USB-Devices-In-Docker-_ttyUSB0_-dev-bus-usb-_-for-fastboot_-adb_-without-using-privileged.html

Hendrione-Moka commented 5 years ago

I got this same issue when using docker for Mac. Because in mac there are no folder /dev/bus/usb like on ubuntu so I can't connect the device on my host to my container. I still stuck and got no clue. Please Help

amrsa1 commented 4 years ago

Is there any option to make the device appearing on both adb server in my machine and inside the container ? so i dont have to manually intervene by killing server and manually allow access to the adb server for container, also to not lose connection with STF

and also to dont lose connection with the STF