Skip to content

Instantly share code, notes, and snippets.

@letroll
Created October 6, 2020 13:26
Show Gist options
  • Save letroll/115e552fb0ba113ba11a69a7df17b886 to your computer and use it in GitHub Desktop.
Save letroll/115e552fb0ba113ba11a69a7df17b886 to your computer and use it in GitHub Desktop.
[android device information] get android device information with adb
#adb shell getprop gsm.baseband.imei
#adb shell "service call iphonesubinfo 1 | cut -c 52-66 | tr -d '.[:space:]'"
#!/bin/bash
# Get the device properties
adb shell getprop | grep "model\|version.sdk\|manufacturer\|ro.serialno\|product.name\|brand\|version.release\|build.id\|security_patch" | sed 's/ro\.//g'
# get the device ime
echo "[device.imei]: [$(adb shell service call iphonesubinfo 1 | awk -F "'" '{print $2}' | sed '1 d'| tr -d '\n' | tr -d '.' | tr -d ' ')]"
# get the device phone number
echo "[device.phonenumber]: [$(adb shell service call iphonesubinfo 19 | awk -F "'" '{print $2}' | sed '1 d'| tr -d '\n' | tr -d '.' | tr -d ' ')]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment