ADB devices is empty in windows docker container
ADB can connect to the device over WiFi and from a networking aspect Docker shouldn't cause any problems for this as long as the network of the Docker Host machine can send traffic to the network of the Android device (if they are the same network, then the answer is definitely yes).
First make sure that the Docker Host machine can reach your device over the WiFi network. A test like ping
ing the IP of your Android device from the Docker Host machine would work. After that, initiate the ADB over WiFi using the ADB on your Docker Host machine (not the one in your container).
adb tcpip 5555
Once that is done, open a terminal in the container and connect to the Android device using the ADB inside the container.
adb connect <ip-address-of-android-device>
adb devices
Usually, when a new connection is established from an "un-trusted" machine, the device requests the user to confirm the connection and so "trust" the machine. An adbkey
is created under %userProfile%/.android
on the machine which the device uses to establish a trust every time the connection is made after the first time it happens so that the user doesn't need to confirm the connection every time. Copy or volume bind the adbkey
into the <container_userProfile_directory>/.android
so device doesn't request from the user to confirm the connection every time.