budtmo / docker-android

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

Cannot -H to the host adb server #177

Open gitathrun opened 5 years ago

gitathrun commented 5 years ago

💬 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?

Louis-me commented 5 years ago

+1

Arne-B commented 5 years ago

I needed to start adb on the host with adb -a -P 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.

MatthiasCartelDkt commented 3 years ago

+1