解决The standalone version of hieararchyviewer is deprecated.
来源:互联网 发布:java飞机大战项目介绍 编辑:程序博客网 时间:2024/05/23 22:44
运行结果如下:
01
The standalone version of hieararchyviewer is deprecated.
02
Please use Android Device Monitor (tools/monitor.bat) instead.
03
01:41:41 E/hierarchyviewer: Unable to get view server version fROM device AQBUYS
04
QKDILNYDZT
05
01:41:41 E/hierarchyviewer: Unable to get view server protocol version from devi
06
ce AQBUYSQKDILNYDZT
07
01:41:41 E/ViewServerDevice: Unable to debug device: xiaomi-2013022-AQBUYSQKDILN
08
YDZT
09
01:41:41 E/hierarchyviewer: Missing forwarded port for AQBUYSQKDILNYDZT
10
01:41:41 E/hierarchyviewer: Unable to get the focused window from device AQBUYSQ
11
KDILNYDZT
12
01:41:43 E/hierarchyviewer: Missing forwarded port for AQBUYSQKDILNYDZT
13
01:41:43 E/hierarchyviewer: Unable to load window data for window <Focused Windo
14
w> on device AQBUYSQKDILNYDZT
15
01:41:43 E/hierarchyviewer: null
解决方案如下:
方案:在手机上安装:ViewServer.apk
注意:需要一直在手机后台开着。
开启ViewServer服务的ViewServer.apk在哪里下载?各市场里居然没有。。那么就自己编译一个吧。
android源代码下载地址:
http://pan.baidu.com/s/1sjIulYl
提取码:wrc8
注意:下载列表包含源码,和可安装的apk,能够直接使用。
本文解决问题:
Android View Hierarchy,解决View Hierarchy不能启动。
-----------------------
View Hierarchy不能启动的原因
To preserve security, Hierarchy Viewer can only connect to devices running a developer version of the Android system
即:出于安全考虑,Hierarchy Viewer只能连接Android开发版手机或是模拟器(准确地说,只有ro.secure参数等于0且ro.debuggable等于1的android系统)。
Hierarchy Viewer在连接手机时,手机上必须启动一个叫View Server的客户端与其进行socket通信。而在商业手机上,是无法开启View Server的,故Hierarchy Viewer是无法连接到普通的商业手机。
Android源码实现这一限制的地方在:
ANDROID源码根目录\frameworks\base\services\java\com\android\server\wm\WindowManageService.java
中的一段:
1
public
boolean
startViewServer(
int
port) {
2
if
(isSystemSecure()) {
3
return
false
;
4
}
5
6
if
(!checkCallingPermission(Manifest.permission.DUMP,
"startViewServer"
)) {
7
return
false
;
8
}
9
....
检验一台手机是否开启了View Server的办法为:
adb shell service call window 3
若返回值是:Result: Parcel(00000000 00000000 ‘……..’)” 说明View Server处于关闭状态
若返回值是:Result: Parcel(00000000 00000001 ‘……..’)” 说明View Server处于开启状态
若是一台可以打开View Server的手机(Android开发版手机 、模拟器or 按照本帖步骤给系统打补丁的手机),我们可以使用以下命令打开View Server:
adb shell service call window 1 i32 4939
使用以下命令关闭View Server:
adb shell service call window 2 i32 4939
2 0
- 解决The standalone version of hieararchyviewer is deprecated.
- 解决The standalone version of hieararchyviewer is deprecated
- 解决php5.3中Deprecated: Assigning the return value of new by reference is deprecated in报错
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated
- The type SmsManager is deprecated错误解决
- 错误The type XXX is deprecated解决
- 解决IDEA This version of the rendering library is more recent than your version of IntelliJ IDEA. Plea
- curl出现Deprecated: curl_setopt(): The usage of the @filename API for file uploading is deprecated. Pl
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- NESASM教程——第二天——源文件的结构
- Vim 字符串替换
- More is better(杭电1856)(并查集)
- 浅谈C++中的运行栈的一些知识
- 实验四——计算文本中单词的个数
- 解决The standalone version of hieararchyviewer is deprecated.
- 第十二周项目3-用递归方法求解(二)
- 利用Java抓取网页数据步骤
- Bootload
- poj 1651 Multiplication Puzzle (区间DP)
- 低秩矩阵在机器视觉中的理解--Low-Rank representations
- 贝贝游戏如何买酒吧豆Q 56448299
- Codeforce 34A-Reconnaissance 2(水)
- 贝贝游戏如何回收酒吧豆Q 56448299