Reputation: 43
I have a question. I was learning how to connect to android emulator from wsl-2. I saw $ADB_SERVER_SOCKET
variable when looking for a solve way for the problem. I can’t find any information about the variable. Can anyone share a official source about the variable?
Upvotes: 2
Views: 2501
Reputation: 42754
adb
has two parts:
Both communicate to each other using TCP. Usually both parts are running on the same computer and even on the same user account.
By using the variable $ADB_SERVER_SOCKET
you can advice the adb client to connect to an adb-server running somewhere else. As WSL2 is a virtual environment separated from your regular Windows you can use it to advice e.g. adb client inside WSL2 to communicate with adb-server on your Windows machine.
export ADB_SERVER_SOCKET=tcp:$WSL_HOST_IP:5037
Your WSL_HOST_IP can be found in /etc/resolv.conf
in the nameserver
entry1.
Upvotes: 4