Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adb shell dumpsys iphonesubinfo not working since Android 5.0 Lollipop

We used to get Device ID/IMEI using the following command:

adb shell dumpsys iphonesubinfo

But since last Android update (5.0 - Lollilop), this command doesn't return anything, I performed this test on both Nexus 4 and Nexus 5.

I know I can get the IMEI from code, which is still working, but does anyone has a workaround for ADB ?

like image 916
Jérémy Avatar asked Nov 18 '14 19:11

Jérémy


People also ask

Why adb shell not working?

Make sure USB debugging is enabled and USB is physically plugged in. Make sure everything is ok with the ADB drivers, double-check the device manager. Check if the device appears in "adb devices", make sure its authorized on the device. Try actual adb shell and other relevant adb stuff.

How can I get IMEI number from adb?

You can check and save the IMEI number of your device by dialing *#06# in your dialer app and taking a screenshot of it. Alternatively, you can use this ADB command on your PC. It will display the IMEI number in the Command Prompt, which you can copy and paste wherever you want for safekeeping.

How do I access adb shell on Android?

To use ADB with your Android device, you must enable a feature called “USB Debugging.” Open your phone's app drawer, tap the Settings icon, and select “About Phone”. Scroll all the way down and tap the “Build Number” item seven times. You should get a message saying you are now a developer.

What is adb Dumpsys?

dumpsys is a tool that runs on Android devices and provides information about system services. You can call dumpsys from the command line using the Android Debug Bridge (ADB) to get diagnostic output for all system services running on a connected device.


2 Answers

You can always just use service call command to call the service methods.

here are the TRANSACTION CODES for the iphonesubinfo service in android-5.0.0_r1:

 1  getDeviceId
 2  getDeviceIdForSubscriber
 3  getImeiForSubscriber
 4  getDeviceSvn
 5  getSubscriberId
 6  getSubscriberIdForSubscriber
 7  getGroupIdLevel1
 8  getGroupIdLevel1ForSubscriber
 9  getIccSerialNumber
10  getIccSerialNumberForSubscriber
11  getLine1Number
12  getLine1NumberForSubscriber
13  getLine1AlphaTag
14  getLine1AlphaTagForSubscriber
15  getMsisdn
16  getMsisdnForSubscriber
17  getVoiceMailNumber
18  getVoiceMailNumberForSubscriber
19  getCompleteVoiceMailNumber
20  getCompleteVoiceMailNumberForSubscriber
21  getVoiceMailAlphaTag
22  getVoiceMailAlphaTagForSubscriber
23  getIsimImpi
24  getIsimDomain
25  getIsimImpu
26  getIsimIst
27  getIsimPcscf
28  getIsimChallengeResponse
29  getIccSimChallengeResponse

Most methods require root. But fortunately getDeviceId (the one you need to get device's IMEI/MEID) does not.

For proper parsing of the service call command output on the device side and without external dependencies see my answer here

Also read Calling Android services from ADB shell for more details.

like image 196
Alex P. Avatar answered Sep 28 '22 08:09

Alex P.


IMEI for sim 1

adb shell service call iphonesubinfo 1 | awk -F "'" '{print $2}' | sed '1 d' | tr -d '.' | awk '{print}' ORS=
like image 30
Sooraj S Avatar answered Sep 28 '22 07:09

Sooraj S