Open sleekweasel opened 5 years ago
Although ddmlib support DdmPreferences get/set AdbHostValue and UseAdbHost, it doesn't seem that it finished implementing it.
I have a proof of concept working by setting DdmPreferences to ${ADBHOST} in BundleToolMain and copying ddmlib/AndroidDebugBridge.java and replacing the two places where it uses DEFAULT_ADB_HOST with references to
String adbHost = DdmPreferences.getUseAdbHost() ? DdmPreferences.getAdbHostValue() : DEFAULT_ADB_HOST;
but I can't find the label to configure in my Android source checkout to propose the fix - would you be able to tell me that?
I don't see a link to my pull request (which requires a ddm lib file to be patched too) so I'll put it here. I think you need ddmlib changed to get this working.
Also, I found some kind of workaround - if the remote emulators' adb is running in promiscuous mode, you can use 'socat' to publish the remote port locally. It's not very nice and if there are connection issues then good luck trying to diagnose them, but:
socat -d tcp-listen:$EMULATOR_ADB_PORT,reuseaddr,fork,bind=$CONTAINER_IP tcp:127.0.0.1:$LOCAL_EMULATOR_ADB_PORT &
We use adb servers on remote machines, and our tests on our CI, so we need this to support ADB_SERVER_SOCKET just like adb, without killing the remote server in case someone else is using one of the remote devices.
Version 0.10.1
Steps
Expected behavior
It would honour ADB_SERVER_SOCKET just like adb does - without killing the remote server.
4.15.0-51-generic #55-Ubuntu SMP Wed May 15 14:27:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux