【发布时间】:2020-01-12 17:21:59
【问题描述】:
在此之前是我的场景说明我的环境以更好地理解我的问题
我有一个 docker 容器在我的机器上运行,具有以下 docker-compose 配置
services:
addb-client:
build:
context: .
dockerfile: Dockerfile
ports:
- 19000:19000
- 19001:19001
- 19002:19002
tty: true
volumes:
- ".:/code"
从我的host 我执行以下命令
adb -a -P 5037 server nodaemon
然后我去下面的输出
adb I 01-12 11:06:05 2493 2493 auth.cpp:437] adb_auth_init...
adb I 01-12 11:06:05 2493 2493 auth.cpp:412] adb_auth_inotify_init...
adb I 01-12 11:06:05 2493 2499 transport.cpp:295] emulator-5554: write thread spawning
adb I 01-12 11:06:05 2493 2498 transport.cpp:282] emulator-5554: read thread spawning
adb I 01-12 11:06:05 2493 2493 transport.cpp:1373] fetching keys for transport emulator-5554
adb I 01-12 11:06:05 2493 2493 auth.cpp:489] Calling send_auth_response
adb I 01-12 11:06:05 2493 2493 adb.cpp:114] emulator-5554: offlin
然后在我的 docker container 中,我运行
adb connect yyy.yyy.yyy.yyy
yyy.yyy.yyy.yyy 是我的安卓模拟器地址,如图
failed to connect to 'yyy.yyy.yyy.yyy:5555': Connection timed out
但是我超时了
我试过了
adb connect xxx.xxx.xxx.xxx
但我得到了connection refused
注意:
1.容器内的命令,如 ,
adb -H yyy.yyy.yyy.yyy devices
效果很好。
如果您能提供任何帮助,我将不胜感激。如果需要任何其他信息,请告诉我。谢谢。
【问题讨论】:
-
你是从 docker 容器运行
adb -H yyy.yyy.yyy.yyy devices吗? -
@Lino 是的,这是正确的
-
有什么解决办法吗?我有同样的问题:/
-
是的,我可以在几个小时内发布,但我认为不值得
标签: docker networking adb