先来看下现象哈,点击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. python篇第5天【变量】

    第4天加班 多个变量赋值 Python允许你同时为多个变量赋值.例如: a = b = c = 1 以上实例,创建一个整型对象,值为1,三个变量被分配到相同的内存空间上. 您也可以为多个对象指定多个变 ...

  2. ubuntu Python2 升级Python3

    今天买了一台阿里的服务器, 想搭建一个爬虫, 但是 服务器是python2的, 需要升级到python3 1. 下载python3的包 wget https://www.python.org/ftp/ ...

  3. ASP.NET Core 6框架揭秘实例演示[02]:基于路由、MVC和gRPC的应用开发

    ASP.NET Core可以视为一种底层框架,它为我们构建出了基于管道的请求处理模型,这个管道由一个服务器和多个中间件构成,而与路由相关的EndpointRoutingMiddleware和Endpo ...

  4. Java中类变量(静态变量)和类方法(静态方法)

    类变量 类变量也叫静态变量或静态属性,是该类所有对象共享的变量任何一个该类的对象去访问它时,取得都是一样的值 语法: 访问修饰符  static  数据类型  变量名 static  访问修饰符  数 ...

  5. k8s集群节点ping不通其他主机的ip

    文章目录 排查过程 本地宿主机网络检查 pod网络检查 tcpdump检查网络 检查flannel网卡 检查宿主机网卡 iptables检查 解决方法 测试环境服务出现问题,服务一直报错认证超时,检查 ...

  6. Java 8 stream的详细用法

    话不多说,直接看代码演示 /** * @description: stream 练习 * @author: hwx * @date: 2022/02/10 **/ public class strea ...

  7. 入职钉钉接近半年,谈谈自身的新人landing体会

    一.适应新环境 到了一个新环境里,身边的一切都比较陌生,与同事和领导都不太熟,一开始说话说不到一起都比较正常.在和同事吃饭的时候,多听多参与聊天,主动一些,逐渐熟悉起来就好了. 另外,我的工作台bas ...

  8. hacker模拟环境

    https://geekprank.com/hacker/

  9. [Matlab]三维曲面绘制实例

    [x,y] = meshgrid(-8:0.5:8); z = sin(sqrt(x.^2+y.^2))./sqrt(x.^2+y.^2+eps); subplot(2,2,1); mesh(x,y, ...

  10. 使用Filter过滤器,解决中文乱码问题

    首先是建立一个filter.java文件,注意implements的是Filter的servlet的那个包: public class filter11 implements Filter { @Ov ...