Android debugging in VS Code and Windows Subsystem for Linux (WSL)

Requirements

SDK Setup

path\to\cmdline-tools\latest\bin
path\to\platform-tools
path\to\emulator
sdkmanager "build-tools;<TARGET_VERSION>" "platforms;android-<TARGET_VERSION>" "platform-tools"
sdkmanager "platforms;android-<TARGET_VERSION>" "platform-tools" "emulator"
sdkmanager — licenses

Emulator Setup

sdkmanager "system-images;android-<TARGET_VESION>;default;x86_64"
avdmanager create avd -name [AVDName] -package "[PACKAGE]" -device "[DEVICENAME]"
Preview of Windows Firewall Rules
"adbSocket": "[WSL_HOST_IP]:5037"

Debugging

emulator -avd [AVDName]
adb -a -P 5037 nodaemon server

Common Errors

[interop]
enabled=false
appendWindowsPath=false

Computer Engineer and entrepreneur from Puerto Rico 🇵🇷 Interested in combining tech, business, design, and multimedia.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store