Skip to content

Instantly share code, notes, and snippets.

@y-polek
Last active October 15, 2020 04:51
Show Gist options
  • Save y-polek/b05ff11147396bd1563aa335ba129f43 to your computer and use it in GitHub Desktop.
Save y-polek/b05ff11147396bd1563aa335ba129f43 to your computer and use it in GitHub Desktop.
#!/bin/sh
# List connected devices (-l for long output)
adb devices
# Restart adbd listening on TCP on PORT
adb tcpip 5555
# Get IP address (Wi-Fi) of connected device
adb shell ip addr show wlan0
# or
adb shell ip route
# or one-liner
adb shell ip route | awk '{print $9}'
# or (on older devices)
adb shell netcfg
# or (on pre Android 10 devices)
adb shell ifconfig
# Connect to a device via TCP/IP [default port=5555]
adb connect HOST[:PORT]
# Disconnect from given TCP/IP device [default port=5555], or all
adb disconnect [HOST[:PORT]]
# Get device manufacturer, model, Android version and API level properties
adb shell getprop
adb shell getprop ro.serialno # serial number (e.g. R28M42Y8E0H)
adb shell settings get secure android_id # Android ID (e.g. 3987ac205a842cc6)
adb shell getprop ro.product.model # model (e.g. SM-G9700)
adb shell getprop ro.product.manufacturer # manufacturer (e.g. samsung)
adb shell getprop ro.build.version.release # android version (e.g. 10)
adb shell getprop ro.build.version.sdk # android SDK version (e.g. 29)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment