先来看下现象哈,点击sdk/tools下uiautomatorviever.bat,点击连接设备的图标,本以为就这么简单,那你就错了:

是不是看到这个瞬间心情就不好了,那么我们该怎么解决这个问题呢,归根结底还是要把界面元素属性找出来呀。。

耐心往下看,吧啦吧啦。。奉上解决方案:

1.在电脑随便某个盘创建两个文本文件

  xx.uix,xx.png

  

2.执行以下命令(-s 设备名称)

  adb -s XEGNW18828001115 shell uiautomator dump /sdcard/app.uix

  adb -s XEGNW18828001115 pull /sdcard/app.uix D:/app.uix

  

  adb -s XEGNW18828001115 shell screencap -p /sdcard/app.png

  adb -s XEGNW18828001115 pull /sdcard/app.png D:/app.png

  

3.导入从设备上获取的截图和资源文件

  

4.见证奇迹的时刻来了  

  

做一棵小草,谁也撼动不了………

UIautomatorviewer连接设备报错Unexpected error while obtaining UI hierarchy的更多相关文章

  1. android-tools下的uiautomatorviewer截图,提示“Unexpected error while obtaining UI hierarchy”

    使用原来工具下的uiautomatorviewer对android 5.1.0的手机,进行截图,是正常的,切换到android10截图,就报错"Unexpected error while ...

  2. 【Mac+Android+uiautomatorviewer】之报错:Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationTargetException

    安卓8.0以后uiautomatorviewer会报错,解决办法如下: 参考:<android 8.0 以后 uiautomator 无法直接使用的问题> 步骤一: 先执行命令:(注意:想 ...

  3. 【Uiautomatorviewer】报错:Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationT...

    android 9.0系统不能用uiautomator识别 解决方法:android 8.0 以后 uiautomator 无法直接使用的问题https://www.cnblogs.com/copyw ...

  4. Android8 以上使用 UIautomator Viewer提示Unexpected error while obtaining UI hierarchy报错(方法二)

    一:最常见的一个问题就是:Android8及以上的系统无法获取到页面,提示报下面的错误 二:解决办法 1.下载新的tools,在下面链接里找到SDK tools下载 http://www.androi ...

  5. uiautomator:Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!

    尝试用android sdk的uiautomatorviewer抓元素的时候报错:Error while obtaining UI hierarchy XML file: com.android.dd ...

  6. error while obtaining ui hierarchy xml file...用 uiautomatorviewer 获取安卓手机软件页面时报错

    Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't ...

  7. uiautomatorviewer 报错 Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!

    在进行自动化时经常需要使用到 uiautomatorviewer获取控件的各个属性,然后在脚本中通过各个控件的属性来操作. 如果使用的是uiautomator2的话,一般都是使用weditor这个来查 ...

  8. 【Android】【问题解决记录】Error obtaining UI hierarchy :Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!

    在使用uiautomatorviewer时遇到两类Error obtaining UI hierarchy报错,分别是: Error while obtaining UI hierarchy XML ...

  9. Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't

    在使用真机定位页面元素时启动uiautomatorviewer.bat ,报错Error while obtaining UI hierarchy XML file: com.android.ddml ...

随机推荐

  1. nginx负载均衡中常见的算法及原理有哪些?

    一.nginx负载均衡常用算法 1.1 轮询 轮询,nginx默认方式.一次将请求分配给各个后台服务器. upstream backserver { server 10.0.0.7; server 1 ...

  2. 抓取并解密HTTPS流量

    WireShark   Wireshark解密TLS数据流,从网上已有资料来看,主要是两种方式:一是服务端私钥直接解密,二是使用SSLKEYLOGFILE获取握手过程中的会话密钥信息进行解密.   这 ...

  3. ASP.NET Core 6框架揭秘实例演示[06]:依赖注入框架设计细节

    由于依赖注入具有举足轻重的作用,所以<ASP.NET Core 6框架揭秘>的绝大部分章节都会涉及这一主题.本书第3章对.NET原生的依赖注入框架的设计和实现进行了系统的介绍,其中设计一些 ...

  4. BeanFactory与FactoryBean有什么区别?

    相同点:都是用来创建bean对象的 不同点:使用beanFactory创建对象的时候,必须要遵循严格的生命周期流程,太复杂了,如果想要简单的自定义某个对象的创建,同时创建好的对象想要交给spring来 ...

  5. c++基础的记录(随笔记录一些基础的东西)

    1.父类的析构函数为什么要加上virtual关键字. 比如说,父类A,子类B.在A* a = new B()的语句的时候,如果父类析构函数没有virtual,我们在delete指针a的时候,会走父类的 ...

  6. hacker模拟环境

    https://geekprank.com/hacker/

  7. 华为eNSP环境,WLAN简介与组网,AP+AC详细配置

    WLAN简单组网一.概述    无线局域网(Wireless Local Area Networks: WLAN)利用无线技术在空中传输数据.话音和视频信号.作为传统布线网络的一种替代方案或延伸,无线 ...

  8. 思迈特软件Smartbi光鲜亮丽的背后是什么在支撑?

    思迈特软件Smartbi是国内知名BI厂商,自2011年成立以来就以提升和挖掘客户的价值为使命,致力于为客户提供一站式商业智能平台和BI解决方案,发展到如今已经获得了来自国家.地方政府.国内外权威分析 ...

  9. Weblogic补丁升级常见问题

    转至:https://blog.csdn.net/weixin_44659716/article/details/106804177 常用企业级版本:Weblogic 11g(weblogic10.3 ...

  10. Python——函数设计与案例

    函数设计与案例 一. 函数的定义与调用 如果在开发程序时,需要多次使用某块代码,但是为了提高编写的效率以及代码的重用,所以把具有独立功能的代码块组织为一个小块,这就是函数 打印如下 print('人生 ...