UIautomatorviewer连接设备报错Unexpected error while obtaining UI hierarchy
先来看下现象哈,点击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的更多相关文章
- android-tools下的uiautomatorviewer截图,提示“Unexpected error while obtaining UI hierarchy”
使用原来工具下的uiautomatorviewer对android 5.1.0的手机,进行截图,是正常的,切换到android10截图,就报错"Unexpected error while ...
- 【Mac+Android+uiautomatorviewer】之报错:Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationTargetException
安卓8.0以后uiautomatorviewer会报错,解决办法如下: 参考:<android 8.0 以后 uiautomator 无法直接使用的问题> 步骤一: 先执行命令:(注意:想 ...
- 【Uiautomatorviewer】报错:Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationT...
android 9.0系统不能用uiautomator识别 解决方法:android 8.0 以后 uiautomator 无法直接使用的问题https://www.cnblogs.com/copyw ...
- Android8 以上使用 UIautomator Viewer提示Unexpected error while obtaining UI hierarchy报错(方法二)
一:最常见的一个问题就是:Android8及以上的系统无法获取到页面,提示报下面的错误 二:解决办法 1.下载新的tools,在下面链接里找到SDK tools下载 http://www.androi ...
- 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 ...
- error while obtaining ui hierarchy xml file...用 uiautomatorviewer 获取安卓手机软件页面时报错
Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't ...
- uiautomatorviewer 报错 Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!
在进行自动化时经常需要使用到 uiautomatorviewer获取控件的各个属性,然后在脚本中通过各个控件的属性来操作. 如果使用的是uiautomator2的话,一般都是使用weditor这个来查 ...
- 【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 ...
- 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 ...
随机推荐
- C快速指南
https://seleniumhq.github.io/docs/quick.html QUICK TOUR Selenium is not just one tool or API but it ...
- Express中使用session
1.安装express-session npm install express-session --save-dev //注意-g无效 2.app.jsvar session = require('e ...
- ASP.NET Core 6框架揭秘实例演示[02]:基于路由、MVC和gRPC的应用开发
ASP.NET Core可以视为一种底层框架,它为我们构建出了基于管道的请求处理模型,这个管道由一个服务器和多个中间件构成,而与路由相关的EndpointRoutingMiddleware和Endpo ...
- 关于基于GDAL库QT软件平台下C++语言开发使用说明
背景前提 地理空间数据抽象库(GDAL)是一个用于读取和编写栅格和矢量地理空间数据格式的计算机软件库,由开源地理空间基金会在许可的X / MIT风格免费软件许可下发布. 作为一个库,它为调用应用程序提 ...
- Linux编译安装升级bash5.1
线上服务器有次做漏洞扫描时,被扫描出有bash漏洞.平时还是比较少遇到有bash的漏洞,好在编译升级比较简单. 测试环境系统:CentOS.Ubuntu 一.下载官网最新bash版本 bash官网下载 ...
- php使用CURL进行模拟登录采集数据
<?php $cookie_path = './'; //设置cookie保存路径 //-----登录要提交的表单数据--------------- $vars['username'] = '张 ...
- 使用Redis完成定时任务
应用场景:在订单业务中,有时候需要对订单设置有效期,有效期到了后如果还未支付,就需要修改订单状态; 与设备进行长链接,如果一段时间内没有收到设备发送的心跳,则修改状态 1.引入依赖 <depen ...
- 盘点Go中的开发神器
本文已收录 https://github.com/lkxiaolou/lkxiaolou 欢迎star. 在Java中,我们用Junit做单元测试,用JMH做性能基准测试(benchmark),用as ...
- C++的两种实例化方式
C++中,类有两种实例化方式.一种是有new关键字,一种没有new关键字.那么,这两种实例化方式有什么区别呢? A a;//(1) a存在于栈上 A* a = new A();//(2) a存在于堆中 ...
- 【C# Task】 ValueTask/Task<TResult>
概要 1.如果异步方法的使用者使用 Task.WhenAll 或 Task.WhenAny,则在异步方法中使用 ValueTask<T> 作为返回类型可能会产生高昂的成本.这是因为您需要使 ...