我知道,在其他版本的作品唯一的命令是“亚行外壳dumpsys iphonesubinfo”,但它似乎并没有在Android 5.0的工作。
Answer 1:
为了得到TelephonyManager.getDeviceId()
你可以这样做:
adb shell service call iphonesubinfo 1
如果你有问题解析service call
输出退房https://gist.github.com/ktnr74/60ac7bcc2cd17b43f2cb
或者你也可以做到这一点与此Windows一行代码在设备侧:
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'
文章来源: How do I get MEID and IMEI information using adb commands on Android 5.0?