Android 工具- Hierarchy View 使用

官方解释:

To run Hierarchy Viewer, follow these steps:

  1. Connect your device or launch an emulator.

    To preserve security, Hierarchy Viewer can only connect to devices running a developer version of the Android system.

可以看到上面有个解释,为了安全,Hierarchy Viewer只能连接开发版的android系统;


但是发现一个问题,eng版本的机器居然也不行,开启不了Viewer Service;


这时候来分析这条开启Viewer Service的命令

adb  shell service call window 1 i32 4939


里面的 的window 1的意思是什么呢?


可以看到IWindowManager.aidl中的代码:

interface IWindowManager
{
    /***
     * ===== NOTICE =====
     * The first three methods must remain the first three methods. Scripts
     * and tools rely on their transaction number to work properly.
     */
    // This is used for debugging
    boolean startViewServer(int port);   // Transaction #1
    boolean stopViewServer();            // Transaction #2
    boolean isViewServerRunning();       // Transaction #3

看到这里面的Notice,我想应该就明白了那条命令的意思吧?

 

对于不清楚自己的window  ?的,可通过一个shell脚本挨个试

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值