Setting up ADB through WSL2
WSL
Docker

WSL and ADB

What we'll be doing:
  1. Installing USBPID
  2. Installing ADB in WSL
  3. Launching an ADB shell



1. Install usbipd through admin PowerShell:

Open Powershell as admin and run the following:

winget install --interactive --exact dorssel.usbipd-win

2. Run usbipd to get the BUSID of the USB device:

List your USB devices:

usbipd list

E.g:

BUSID  VID:PID    DEVICE                                                        STATE
1-10   1f3a:1007  Tina                                                          Not shared

3. Now, bind the USB device:

List your USB devices:

usbipd bind --busid 1-10

4. Attach the USB device to WSL2:

List your USB devices:

usbipd attach --wsl --busid 1-10

5. In WSL, confirm the USB device is now visible:

mattpc@MattPC:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 1f3a:1007 Allwinner Technology Tina
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

6. Install ADB in WSL:

Open your WSL2 terminal and update your package list:

sudo apt update

Install ADB:

sudo apt install adb

7. Verify ADB Installation:

Check if ADB is installed correctly by running:

adb version
You should see output similar to:
 Android Debug Bridge version 1.0.41
 Version 34.0.5-10900879
 Installed as /usr/bin/adb
 Running on Windows 10.0.22621

8. Connect Your Android Device via USB:

Ensure your Android device is connected to your computer via USB. Check if your device is recognized by running:

adb devices
The output should list your device:
List of devices attached
20080411        device

9. Launch an ADB Shell:

You can now launch an ADB shell to interact with your device:

adb shell
This should drop you into a shell on your Android device:
root@MIYOO282:/#

Terminal Icon

mattpc@MattPC:~$ adb shell

BusyBox v1.27.2 () built-in shell (ash)

_____ _ __ _

|_ _||_| ___ _ _ | | |_| ___ _ _ _ _

| | _ | || | | |__ | || || | ||_'_|

| | | || | || _ | |_____||_||_|_||___||_,_|

|_| |_||_|_||_|_| Tina is Based on OpenWrt!

----------------------------------------------

Tina Linux (Neptune, 5C1C9C53)

----------------------------------------------

root@MIYOO282:/# exit

mattpc@MattPC:~$

----------------------------------------------