There have been a lot of articles on how the Hierarchy Viewer is used, and here is a step-by-step demonstration of how to use it, Ddna's "Android Tool" ignored UI Viewer: Hierarchy Viewer and Zhang Xingye's Android UI Optimization-The use of the Hierarchyviewer tool is great.
Hierarchy Viewer has two uses, one is used to analyze the current page view level, but also can analyze the layout of time statistics (measrue, Layout, Draw) The specific time required, this article is mainly concerned about the statistical function of the layout time.
The following is a page layout on an Android 2.3.7 phone, and clicking on a node will show the exact time it takes (Measrue, Layout, Draw):
Found that there is a problem, each of the above is shown n/A, need to click on the re-statistics click "Profile Node", because there is no connection to the phone so this button is a gray image is only a demonstration under the "Profile Node" location
Here is the final effect, you can see the execution of Measue, Layout, Draw
Problems that occur after the phone is connected [hierarchyviewer]unable to get View server version from device ******
[Hierarchyviewer] Unable to get View server protocol version from device ******
[Viewserverdevice] Unable to debug device: ******
[Hierarchyviewer] Unable to get the focused window from device ******
How to turn on Viewserver on the root phone so that hierachyviewer can connect
Resolving view hierarchy Cannot start
Reference Android layout Tricks #1Optimizing layout hierarchiesandroid Performance Optimization Series---improving layout performance (i)