get second imei number through adb shell

0

I was able to get one imei number through adb shell with command

adb shell service call iphonesubinfo 1

But device has two imei numbers ,

How to get second imei number through adb shell

The output of adb shell service call iphonesubinfo 1 is as below (which is inbetween quotes)

Result: 

Parcel(
0x00000000: 00000000 0000000f 00320031 00340033 '........1.2.3.4.'
0x00000010: 00360035 00380037 00300039 00380039 '5.6.7.8.9.0.9.8.'
0x00000020: 00360037 00000035                   '7.6.5... ') 

imei=123456789098765

Help me to find second imei......

adb
asked on Stack Overflow Feb 6, 2016 by G murali Madhav • edited Feb 6, 2016 by Alex P.

1 Answer

0

Yes, you can get both IMEI with service call iphonesubinfo.

Though the order in which they are fetch is not always definite in my experience, but you can always fetch both and compare to one if you need to.

/system/bin/service call iphonesubinfo 3 i32 1 | cut -d\' -f2 | sed -e 's/[^0-9]//g' | tr -d '\n'


/system/bin/service call iphonesubinfo 3 i32 2 | cut -d\' -f2 | sed -e 's/[^0-9]//g' | tr -d '\n'

You can substitute /system/bin/service with adb shell service if you are running from adb and not from device shell.

answered on Stack Overflow Jul 6, 2020 by Vijay

User contributions licensed under CC BY-SA 3.0