Is there an android shell or adb command that I could use to get a device's IMEI/MEID?

I figured out how to do this. You need to run adb shell dumpsys iphonesubinfo in a shell. It will give you a bit more than you need, but it will also return IMEI or MEID number.

Edit (2017): In Android 5.0+ you'll need to use the service call command. More info about that can be found here.


For IMEI you can use:

adb shell service call iphonesubinfo 1 | awk -F "'" '{print $2}' | sed '1 d' | tr -d '.' | awk '{print}' ORS=

The following ADB command works for me to get the IMEI:

adb shell "service call iphonesubinfo 1 | cut -c 52-66 | tr -d '.[:space:]'"

Tags:

Android

Adb