The question is simple. How do I get my phone number via adb. It's not listed in getprop. I guess it's possible to find it under service or settings but i didn't found it. It's a Huawei device with android 8.0 installed.
Asked
Active
Viewed 2,732 times
1
-
1there is a type of sim cards, which don't provide the phone number to the phone, so there is a chance that you simply can't get it on some sim cards – Vladyslav Matviienko Nov 30 '18 at 13:00
-
Ok, i am able to see the number under contacts if i check on my personal info. – wuseman Nov 30 '18 at 13:03
1 Answers
1
This might work in some cases.
adb shell service call iphonesubinfo 13
By running this command I am calling getLine1Number method.
This is the aidl file I am referring to.
To know more about adb service command read this
To know the reason why it will not work in other cases, refer this.
royatirek
- 2,017
- 1
- 18
- 33
-
1
-
Edited it. Actually getLine1Number was the 13th line in the aidl file. – royatirek Nov 30 '18 at 19:18