用hierarchyviewer时报错:
[hierarchyviewer]Unable to get view server version from device xxxx;
是因为Android出于安全考虑,Hierarchy Viewer只能连接开发版手机或模拟器;
不过小米开发版可以获得root权限;在权限管理中打开root权限,手机重启后,通过
adb shell service call window 1 i32 4939命令打开View Server;
返回Result: Parcel(00000000 00000000 '........'),表示关闭状态
adb shell service call window 2 i32 4939命令关闭View Server;
返回Result: Parcel(00000000 00000001 '........'),表示打开状态



其他机型暂时没试。。。
网友评论