Skip to content

Instantly share code, notes, and snippets.

@kdb13
Created January 24, 2022 06:47
Show Gist options
  • Save kdb13/e304b1b36a51e91ed01c6b22f59172c6 to your computer and use it in GitHub Desktop.
Save kdb13/e304b1b36a51e91ed01c6b22f59172c6 to your computer and use it in GitHub Desktop.
A Linux alias command to connect to your Android device with ADB wirelessly.
# Put the following lines within your .bashrc file.
# Get default gateway's IP address
alias defaultip="ip r | grep default | grep -o -E "[0-9]+.[0-9]+.[0-9]+.[0-9]+""
# ADB shortcut
# Note: Linux users shall replace "adb.exe" with just adb.
# I'm using WSL and hence I used adb.exe to access the Windows version
alias connect="adb.exe connect `defaultip`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment