Skip to content

Instantly share code, notes, and snippets.

@completejavascript
Last active March 20, 2019 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save completejavascript/7f6f668b9d7f7694871600c23fd66ca5 to your computer and use it in GitHub Desktop.
Save completejavascript/7f6f668b9d7f7694871600c23fd66ca5 to your computer and use it in GitHub Desktop.
# Get device ID to connect:
$ adb devices
# Get android version
$ adb shell getprop ro.build.version.release
1. Android <= 4.x:
=> Get imei: adb shell dumpsys iphonesubinfo
=> Get serial number: adb shell getprop ro.serialno
=> Get mac address: adb shell cat /sys/class/net/wlan0/address
=> Get product model: adb shell getprop ro.product.model
2. Android's version >= 5.x
=> Get imei: adb shell service call iphonesubinfo 1
=> Get serial number: adb shell getprop ril.serialnumber
=> Get mac address: adb shell cat /sys/class/net/wlan0/address
=> Get product model: adb shell getprop ro.product.model
Ref: https://mazhuang.org/awesome-adb/README.en.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment