How to connect Android Studio running inside WSL2 with connected devices or android emulator running on host

papadi picture papadi · Jun 2, 2020 · Viewed 7k times · Source

I'm running Android Studio (currently in version 3.6.1) under Ubuntu 18.04 in WSL 2 (Windows 10 2004), which now supports GUI. Since virtualization inside WSL2 doesn't work, I need to keep running my emulator on the host and of course, connected devices which I use for debugging my android app appear on the host.

How can Android Studio see the emulator and devices appearing on the host?

Answer

lau picture lau · Aug 21, 2020

There is a way for the connected devices, but this has to be done one by one:

  1. on windows:adb tcpip 5555
  2. on wsl2: adb connect [ip device]:5555

and in android studio should you see the device