android-emulator-container-scripts icon indicating copy to clipboard operation
android-emulator-container-scripts copied to clipboard

Adb reverse commands not working

Open dhoomakethu opened this issue 5 years ago • 2 comments

Setting up reverse proxy on an android emulator running inside docker is not working. I keep getting error: more than one device/emulator error .

I am using run.sh to start the container. Here is the command I use to setup reverse proxy

$ adb devices
List of devices attached
localhost:5555	device

$ adb reverse tcp:50051 tcp:50051
error: more than one device/emulator

$ adb -s localhost:5555 reverse tcp:50051 tcp:50051
error: more than one device/emulator

dhoomakethu avatar Jan 30 '20 03:01 dhoomakethu

I'm seeing this on Android 8 and earlier, but not on 9 & 10.

May be related to https://github.com/Genymobile/scrcpy/issues/5#issuecomment-381316950 and https://android-review.googlesource.com/c/platform/system/core/+/664644

qmfrederik avatar Jun 04 '20 21:06 qmfrederik

https://issuetracker.google.com/issues/37066218 (via https://www.genymotion.com/blog/open-source-project-scrcpy-now-works-wirelessly/) pretty much confirms it; there's a bug in adbd (running on the device side) which will cause adb reverse to fail if the device is connected over TCP (e.g. adb connect/what you do with the emulator).

This is fixed in Android P.

qmfrederik avatar Jun 04 '20 21:06 qmfrederik