How to Connect ADB Devices to WSL (Windows Subsystem for Linux)

How to Connect ADB Devices to WSL (Windows Subsystem for Linux)

🔌 How to Connect ADB Devices to WSL (Windows Subsystem for Linux)

Whether you're a developer, a tinkerer, or just curious—sometimes you need to use ADB (Android Debug Bridge) from within your WSL (Windows Subsystem for Linux) environment. But by default, WSL can't directly detect Android devices connected to Windows.

Don’t worry! This guide will walk you through connecting your Android device to WSL without running a second ADB server, ensuring a clean, conflict-free setup.

📌 Why Use ADB in WSL?

WSL provides a full Linux development environment directly in Windows—great for scripting, automation, and cross-platform development. However, if you're building Android apps or debugging USB devices, WSL can't directly access hardware. The solution? Let Windows manage ADB, and let WSL use it via a symlink.

🧰 Prerequisites

  • Windows 10/11 with WSL installed (WSL2 recommended)
  • An Android phone with USB Debugging enabled
  • Basic knowledge of terminal/command line
  • ADB installed on your Windows host (not WSL yet)

✅ Step 1: Locate ADB on Windows

First, check if ADB is already installed on your Windows system.

where adb

If it returns a path like:

C:\platform-tools\adb.exe

Great! You can skip downloading it.

🧾 Step 2: If ADB Isn’t Installed (Optional)

  1. 👉 Visit: https://developer.android.com/studio/releases/platform-tools
  2. Download and extract the ZIP (e.g., to C:\platform-tools)
  3. Inside that folder, you’ll see adb.exe

🚫 Step 3: Remove ADB from WSL

We want WSL to use Windows' ADB, not its own version.

sudo apt purge adb -y

🔗 Step 4: Link Windows ADB to WSL

Now, we’ll link the Windows ADB binary into your WSL environment.

sudo ln -s /mnt/c/platform-tools/adb.exe /usr/bin/adb

Note: Windows drives (C:, D:, etc.) are mounted under /mnt/ in WSL.

Example: C:\platform-tools\adb.exe becomes /mnt/c/platform-tools/adb.exe

🧪 Step 5: Test ADB in WSL

Plug in your Android device and authorize it when prompted.

adb devices

You should see something like:

List of devices attached
ABC123456789    device

✅ Congratulations! You're now running ADB on WSL via your Windows installation.

🔁 Bonus: Add to PATH (Optional)

To avoid typing the full path every time, you can add it to your .bashrc or .zshrc:

echo 'export PATH=$PATH:/mnt/c/platform-tools' >> ~/.bashrc
source ~/.bashrc

Then just run adb from anywhere.

🧯 Troubleshooting

  • Reconnecting USB
  • Running adb kill-server && adb start-server in Windows CMD, not WSL
  • Ensuring USB Debugging is enabled on your Android phone

🎉 Conclusion

Now your WSL is ADB-capable without any USB passthrough hacks. By linking the Windows ADB to your Linux environment, you're using the best of both worlds seamlessly. This method avoids the pain of dual ADB instances and works great for Android development or automation within WSL.

Got questions or tips? Drop them in the comments below! 👇
Happy coding 🔧📱🐧

Comments (0)

No comments yet. Be the first to comment!

Leave a Comment