No device found when running in WSL with Windows emulator #55

Closed
opened 2025-08-09 17:13:10 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @bombillazo on 11/2/2020

Context

Hello. First off, great extension, thank you for your work.

I have an Android project in my WSL file system. I have the same version of the SDK tools installed in my WSL and Windows Host.

Windows PowerShell

PS C:\WINDOWS\system32> adb version
Android Debug Bridge version 1.0.41
Version 30.0.4-6686687
Installed as D:\AppData\Android\platform-tools\adb.exe

WSL bash

$ adb version
Android Debug Bridge version 1.0.41
Version 30.0.4-6686687
Installed as /home/user/android/platform-tools/adb

In the WSL I add ADB_SERVER_SOCKET to my env to use my Windows host as the adb host to listen.

export ADB_SERVER_SOCKET=tcp:$(cat /etc/resolv.conf | grep nameserver | cut -d' ' -f2):5037

I create a FireWall rule on my Windows host to allow traffic for the debug port 5037, plus added 5555 and 5554 for good measure. I run the following on my Windows host so adb in WSL can see the devices running on the Windows host:

Windows PoweShell
adb -a -P 5037 nodaemon server

I launch an emulator on my Windows host (WSL does not support virtualization, so cannot run the Android emulator locally on WSL). After all this, I see the device in my WSL:

WSL

$ adb devices
List of devices attached
emulator-5554   device

Expected Behavior

The launched debugger finds and connects successfully to Android emulated device.

Actual Behavior

When the debugger is launched, no device is found.

Checking build
Warning: Build is not up-to-date. Source files may not match execution when debugging.
Searching for devices...
Found 0 devices
Launch failed: No devices are connected
*Originally created by @bombillazo on 11/2/2020* ### Context Hello. First off, great extension, thank you for your work. I have an Android project in my WSL file system. I have the same version of the SDK tools installed in my WSL and Windows Host. Windows PowerShell ```powershell PS C:\WINDOWS\system32> adb version Android Debug Bridge version 1.0.41 Version 30.0.4-6686687 Installed as D:\AppData\Android\platform-tools\adb.exe ``` WSL bash ```bash $ adb version Android Debug Bridge version 1.0.41 Version 30.0.4-6686687 Installed as /home/user/android/platform-tools/adb ``` In the WSL I add ADB_SERVER_SOCKET to my env to use my Windows host as the adb host to listen. `export ADB_SERVER_SOCKET=tcp:$(cat /etc/resolv.conf | grep nameserver | cut -d' ' -f2):5037` I create a FireWall rule on my Windows host to allow traffic for the debug port 5037, plus added 5555 and 5554 for good measure. I run the following on my Windows host so adb in WSL can see the devices running on the Windows host: Windows PoweShell `adb -a -P 5037 nodaemon server` I launch an emulator on my Windows host (WSL does not support virtualization, so cannot run the Android emulator locally on WSL). After all this, I see the device in my WSL: WSL ``` $ adb devices List of devices attached emulator-5554 device ``` ### Expected Behavior The launched debugger finds and connects successfully to Android emulated device. ### Actual Behavior When the debugger is launched, no device is found. ``` Checking build Warning: Build is not up-to-date. Source files may not match execution when debugging. Searching for devices... Found 0 devices Launch failed: No devices are connected ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/android-dev-ext#55
No description provided.