
To use adb from windows, you can follow my other post here. So each time WSL2 starts, we need to kill the adb server of WSL2. Setting for Windows and WSL Open the solution using Visual Studio In the debugger menu, next to the green arrow, select WSL (or WSL 2 depending on the visual. Those environment variables need to be added before using the sdk-manager tool from the first snippet.īe aware also that the adb server must not be started in WSL2 since we want to use the emulator in Windows. Step 1: Install JDK on Ubuntu 20.04 and Linux Mint 20 Step 2: Verify the JDK installation Step 3: Add android-studio official repository Step 4: Update apt. zshrc file: # JDK if ] then export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" export PATH="$PATH:$JAVA_HOME/bin" fi # Android tools if ] then export PATH="$HOME/android-sdk-tools:$HOME/android-sdk-tools/bin:$PATH" export PATH="$HOME/.android/platform-tools:$PATH" export ANDROID_HOME="$HOME/.android" export ANDROID_SDK_ROOT="$HOME/.android" export REPO_OS_OVERRIDE="linux" adb kill-server 2> /dev/null export ADB_SERVER_SOCKET=tcp:$(cat /etc/nf | grep nameserver | cut -d' ' -f2):5037 fi

Some environment variables are required by Java and Android tools.
