[GH-ISSUE #177] Cannot -H to the host adb server #126

Open
opened 2026-03-01 15:40:44 +03:00 by kerem · 3 comments
Owner

Originally created by @gitathrun on GitHub (Jul 16, 2019).
Original GitHub issue: https://github.com/budtmo/docker-android/issues/177

💬 Questions and Help

Please make sure that it is an issue / a feature request. If it is a question / help wanted, please visit our group chat. Thank you!

Hello, I am trying to the real-device version of the docker image, but when I try to "adb -H " to the host machine adb server, following error shows:

image

My host machine is Linux and my docker info is listed below, the real android device is connected to this host machine and the host machine adb cmd can recognise the device as well.
And I try to access the Host Linux machine from a PC (my development machine).

Containers: 23
 Running: 1
 Paused: 0
 Stopped: 22
Images: 109
Server Version: 18.09.7
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: nvidia runc
Default Runtime: runc
Init Binary: docker-init
containerd version: xxxxx
runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
init version: fec3683
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.15.0-54-generic
Operating System: Ubuntu 16.04.6 LTS
OSType: linux
Architecture: x86_64
CPUs: 12
Total Memory: 15.61GiB
Name: xxxxxxxxxx
ID: xxxxxxx
Docker Root Dir: xxxx
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

WARNING: No swap limit support

I have used the x86 simulator version docker image, it works fine when I access the emulator from a remote PC, and the virtual device show up in my Android Studio. But why it blocks the real device docker?

Originally created by @gitathrun on GitHub (Jul 16, 2019). Original GitHub issue: https://github.com/budtmo/docker-android/issues/177 ## 💬 Questions and Help **Please make sure that it is an issue / a feature request. If it is a question / help wanted, please visit [our group chat](https://gitter.im/budtmo/docker-android). Thank you!** Hello, I am trying to the real-device version of the docker image, but when I try to "adb -H " to the host machine adb server, following error shows: ![image](https://user-images.githubusercontent.com/22137687/61312262-f6bb4080-a7ef-11e9-8180-c4aa33921086.png) My host machine is Linux and my docker info is listed below, the real android device is connected to this host machine and the host machine adb cmd can recognise the device as well. And I try to access the Host Linux machine from a PC (my development machine). ``` Containers: 23 Running: 1 Paused: 0 Stopped: 22 Images: 109 Server Version: 18.09.7 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: nvidia runc Default Runtime: runc Init Binary: docker-init containerd version: xxxxx runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f init version: fec3683 Security Options: apparmor seccomp Profile: default Kernel Version: 4.15.0-54-generic Operating System: Ubuntu 16.04.6 LTS OSType: linux Architecture: x86_64 CPUs: 12 Total Memory: 15.61GiB Name: xxxxxxxxxx ID: xxxxxxx Docker Root Dir: xxxx Debug Mode (client): false Debug Mode (server): false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false Product License: Community Engine WARNING: No swap limit support ``` I have used the x86 simulator version docker image, it works fine when I access the emulator from a remote PC, and the virtual device show up in my Android Studio. But why it blocks the real device docker?
Author
Owner

@Louis-me commented on GitHub (Jul 21, 2019):

+1

<!-- gh-comment-id:513518968 --> @Louis-me commented on GitHub (Jul 21, 2019): +1
Author
Owner

@Arne-B commented on GitHub (Aug 28, 2019):

I needed to start adb on the host with adb -a -P <PORT_NUMBER> nodaemon server .
Only then adb was bound to external addresses. (Seems like a bug to me.). Or you could do some kind of local to external port forwarding. Like the containers are doing (https://github.com/budtmo/docker-android/blob/master/src/port_forward.sh) Thats why you can connect to your emulators.

The way I am using real devices now is to spin up a separate container for each device and share the /dev/bus/usb:/dev/bus/usb volume. Then i simply set environment var ANDROID_SERIAL= to the specific device ID for each container. This way screen mirroring and so on works on each instance, which you can target individually.

<!-- gh-comment-id:525671281 --> @Arne-B commented on GitHub (Aug 28, 2019): I needed to start adb on the host with adb -a -P <PORT_NUMBER> nodaemon server . Only then adb was bound to external addresses. (Seems like a bug to me.). Or you could do some kind of local to external port forwarding. Like the containers are doing (https://github.com/budtmo/docker-android/blob/master/src/port_forward.sh) Thats why you can connect to your emulators. The way I am using real devices now is to spin up a separate container for each device and share the /dev/bus/usb:/dev/bus/usb volume. Then i simply set environment var ANDROID_SERIAL= to the specific device ID for each container. This way screen mirroring and so on works on each instance, which you can target individually.
Author
Owner

@MatthiasCartelDkt commented on GitHub (May 6, 2021):

+1

<!-- gh-comment-id:833592863 --> @MatthiasCartelDkt commented on GitHub (May 6, 2021): +1
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-android#126
No description provided.