Using ADB with WSL2
1 min readJan 13, 2020
In a Windows 10 environment, in order to use the Android emulator in Windows and starting a React-Native app in WSL2; here are the required steps I need to configure the computer to use ADB (Android Debug Bridge).
Computer specifications:
- Windows 10 Pro Insider — build 19541
- WSL 2 — Ubuntu 18.04.3 LTS
- ADB — version 1.0.41 (29.0.5–5949299)
What the script does:
- remove any previous port mapping on port 5037 (default port of ADB)
- start the ADB server
- add port mapping for 0.0.0.0:5037 to 127.0.0.1:5037
- start WSL (to ensure the virtual interface is created; see below)
- disable the firewall for the virtual interface “vEthernet (WSL)”