How to get to Hierarchy View while running the app on my device connected to android studio

江枫思渺然 提交于 2019-12-13 00:46:34

问题


Okay, so I am trying to get to know the android studio and been playing with few projects. My question is how can I run or debug an app and then open the hierarchy view on it. If I try to open the Android Device Monitor, while the app is running, I get the message: "Following debug sessions will be closed:xx". I see a small Android DDMS window, which opens while debugging or running, where I see the options for Method tracing and allocation tracking, but what about Hierarchy view?


回答1:


I'm not sure about the gui, but there are instructions for launching it from the cli, here.

  1. From a terminal, launch hierarchyviewer from the <sdk>/tools/ directory.

You can determine your <sdk> directory in Android Studio via: File -> Project Structure -> SDK Location




回答2:


execute the following:

./Users/<YourUser>/Library/Android/sdk/tools/bin/uiautomatorviewer

I've made an alias for it:

alias viewer='./Users/<YourUser>/Library/Android/sdk/tools/bin/uiautomatorviewer'

path might be different so locate it:

locate uiautomatorviewer


来源:https://stackoverflow.com/questions/27869846/how-to-get-to-hierarchy-view-while-running-the-app-on-my-device-connected-to-and

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!