Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
Created August 22, 2020 04:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pythoninthegrass/ef083621350a52a0a9f42d96365dea53 to your computer and use it in GitHub Desktop.
Save pythoninthegrass/ef083621350a52a0a9f42d96365dea53 to your computer and use it in GitHub Desktop.
Share ADB server with WSL 2 guest
#!/usr/bin/env bash
# SOURCE: https://github.com/microsoft/WSL/issues/4619#issuecomment-596990676
# On Windows host run:
# adb -a -P 5037 nodaemon server
ip_addr=$(cat /etc/resolv.conf | tail -n1 | cut -d " " -f 2)
adb kill-server
export ADB_SERVER_SOCKET=tcp:${ip_addr}
adb devices | awk 'NR>1{print $1}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment