如何在Android 5.0上使用adb命令获取MEID和IMEI信息? [英] How do I get MEID and IMEI information using adb commands on Android 5.0?
本文介绍了如何在Android 5.0上使用adb命令获取MEID和IMEI信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道在其他版本上可用的唯一命令是 adb shell dumpsys iphonesubinfo,但在Android 5.0上似乎不起作用。
The only command that I know that works on other versions is "adb shell dumpsys iphonesubinfo" but it doesn't seem to work on Android 5.0.
推荐答案
要获取 TelephonyManager.getDeviceId()
,您可以执行以下操作:
To get TelephonyManager.getDeviceId()
you can do:
adb shell service call iphonesubinfo 1
如果您在解析<$ c时遇到问题$ c>服务调用输出以检出 https://gist.github.com/ ktnr74 / 60ac7bcc2cd17b43f2cb
If you have problems with parsing service call
output check out https://gist.github.com/ktnr74/60ac7bcc2cd17b43f2cb
或者您也可以使用此Windows一线版在设备端进行操作:
Or you can do it on the device side with this Windows one-liner:
adb shell "service call iphonesubinfo 1 | grep -o '[0-9a-f]\{8\} ' | tail -n+3 | while read a; do echo -n \\u${a:4:4}\\u${a:0:4}; done"
或在Linux中:
adb shell 'service call iphonesubinfo 1 | grep -o "[0-9a-f]\{8\} " | tail -n+3 | while read a; do echo -n "\u${a:4:4}\u${a:0:4}"; done'
这篇关于如何在Android 5.0上使用adb命令获取MEID和IMEI信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文