Android      uiautomatorviewer抓取Android页面失败的处理   

本例场景:
手机:小米2SC,安卓5.0.2/MUI9.2;小米Note3,安卓9/MUI12

ERROR: null root node returned by UiTestAutomationBridge.
Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException :Remote object doesn't exits!

https://blog.csdn.net/q915730058/article/details/108150792
https://blog.csdn.net/qq_40280920/article/details/104842031

uiautomatorviewer.jar
LvmamaXmlKit.jar
链接: https://pan.baidu.com/s/1YC3tBYAdqlDx6nS85ofYJQ
提取码: tdyg

使用指令 adb push LvmamaXmlKit.jar /data/local/tmp/ 将LvmamaXmlKit文件推到手机的固定目录。
替换uiautomatorviewer文件到 %android-sdk%/tools/lib/uiautomatorviewer-*.jar 。



实在不行,就用python方案。http://www.gaohaiyan.com/2338.html

如果有哪个App总是不能解析,顶部状态栏可以,但App界面却失败,试着更新到最新版,或者老版。原生开发和混合开发、跨平台开发解析效果不太一样。另外,Android原生的测试API UIAutomator2获取控件的效果总是差强人意,还是转python比较理想。

-end

承接App定制、企业web站点、办公系统软件 设计开发,外包项目,毕设