Is there some adb or android shell command that I could run that would return a device\'s IMEI or MEID number? Preferably that\'s all that would be returned.
For the IMEI, maybe this command is easier to understand
db -s shell service call iphonesubinfo 1 | cut -c 52-66 | tr -d '.[:space:]'
db -s shell service call iphonesubinfo 1
gets the full result, for exampleResult: Parcel(
0x00000000: 00000000 0000000f 00350033 00340037 '........3.5.7.4.'
0x00000010: 00350032 00370030 00310032 00390039 '2.5.0.7.2.1.9.9.'
0x00000020: 00370034 00000032 '4.7.2... ')
cut -c 52-66
trims away all columns except 52-66, using the above example........3.5.7.4
2.5.0.7.2.1.9.9
4.7.2...
tr -d '.[:space:]'
trims off any '.' and white space, using the example above357425072199472
Warning A downside of this approach is that it is brittle, in the sense that the output must always be in the same format, having the exact same columns. I verified it on CentOs and OS X, but an update to the adb version could break this command simply by adjusting the whitespace in the output.