有没有办法通过adb获取手机的电话号码?
我认为 dumpsys 是一个可能的答案,但系统服务似乎都没有跟踪手机自己的号码。
iphonesubinfo
服务“跟踪”订户信息,包括电话号码。很遗憾iphonesubinfo
服务没有实现dump()
方法所以 dumpsys 不显示任何内容。你将不得不使用service call
呼叫命令IPhoneSubInfo.getLine1Number()
or IPhoneSubInfo.getMsisdn()
反而
根据 Android 版本和您的运营商,以下一两个命令将告诉您电话号码(service call
命令需要root
特权):
service call iphonesubinfo 4
service call iphonesubinfo 5
service call iphonesubinfo 6
service call iphonesubinfo 7
service call iphonesubinfo 8
如果您想找到适合您的特定设备的正确代码 - 从以下位置下载脚本从 ADB shell 调用 Android 服务 http://ktnr74.blogspot.com/2014/09/calling-android-services-from-adb-shell.html像这样发布并运行它:
./get_android_service_call_numbers.sh iphonesubinfo | grep getLine1Number
UPDATE
Android 5.0的交易代码:
service call iphonesubinfo 11 # getLine1Number()
service call iphonesubinfo 15 # getMsisdn()
Android 5.1的事务代码:
service call iphonesubinfo 13 # getLine1Number()
service call iphonesubinfo 17 # getMsisdn()
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)