Is there a way to get the phone number of a phone over adb?
I looked at dumpsys as a likely answer, but none of the system services seem to keep track of the phone's own number.
Is there a way to get the phone number of a phone over adb?
I looked at dumpsys as a likely answer, but none of the system services seem to keep track of the phone's own number.
iphonesubinfo
service "keeps track" of the subscriber information including phone numbers. Unfortunatelyiphonesubinfo
service does not implement thedump()
method so dumpsys shows nothing. You will have to useservice call
command to callIPhoneSubInfo.getLine1Number()
orIPhoneSubInfo.getMsisdn()
insteadDepending on the android version and your carrier one or two of the following commands will tell you the phone number (
service call
commands requireroot
privileges):If you want to find out the proper code for your specific device - download the script from Calling Android services from ADB shell post and run it like this:
UPDATE
Transaction codes for Android 5.0:
Transaction codes for Android 5.1: