56

I tried searching on here but couldn't find the answer.

I'm looking for a way to launch the Hierarchy Viewer from within Android Studio, rather than having to launch it at the command-line. I've recently migrated to Android Studio from Eclipse, and this functionality was available under the DDMS set of tools in that IDE.

I've looked under the "Android" toolbar, and can see the screen-shot functionality there, but not the hierarchy viewer. I've also looked under Tools > Android in the menu system, and it's not there either.

George Mulligan
  • 11,813
  • 6
  • 37
  • 50
Carl Anderson
  • 3,446
  • 1
  • 25
  • 45
  • 1
    [How can I Use Hierarchy Viewer](https://stackoverflow.com/a/45055690/6521116) – LF00 Jul 12 '17 at 11:00
  • [From the docs](https://developer.android.com/studio/profile/hierarchy-viewer): *Hierarchy Viewer is deprecated. If you're using Android Studio 3.1 or later, you should instead use Layout Inspector to inspect your app's view hierarchy at runtime. To profile the rendering speed of your app's layout, use [Window.OnFrameMetricsAvailableListener](https://developer.android.com/reference/android/view/Window.OnFrameMetricsAvailableListener.html) as described in [this blog post](https://android-developers.googleblog.com/2017/08/understanding-performance-benefits-of.html).* – Albert Vila Calvo Sep 02 '19 at 20:23

2 Answers2

86

DDMS, Hierarchy Viewer, openGL Tracer etc all moved into Android Device Monitor. To access:

  1. In Android Studio: "Tools" menu > Android > Android Device Monitor
  2. In ADM: "Window" Menu > Perspective
  3. Click on Hierarchy Viewer.
Alexander Lucas
  • 22,171
  • 3
  • 46
  • 43
  • 4
    it make you lose adb connection in android studio, so there should be a better way to do this – Apperside Apr 07 '15 at 09:05
  • 4
    I can't find it. There is no Window or perspective button inside the Android Monitor window. The top android studio window menu also doesn't have a perspective item. All I see in Android Monitor are logcat, memory, CPU|GPU and network tabs. – rockgecko Oct 28 '15 at 02:54
  • 2
    @rockgecko, you should open 'Android Device Monitor' which is different than the 'Android Monitor' in Android Studio. Check again the step 1. in Alexander answer. – Ignacio Hagopian Nov 22 '15 at 16:59
  • 6
    I can't find the hierarchy viewer neither in the sdk/tools directory nor in the Android Device Monitor after I upgrade my Android Studio to 2.3. Do you know how to solve it ? – Allen Vork Mar 13 '17 at 08:31
  • Edited post to be slightly clearer. You have to click the "Window" menu along the top of Android Device Monitor. From there click on the "Perspective" menu item. – Alexander Lucas Jun 13 '17 at 19:59
33

Android Studio 4.0

There is a new live layout inspector. View > Tool Windows > Layout Inspector

Later versions of Android Studio 4.x also have it directly under Tools > Layout Inspector

For more information on its usage see this article or the developer documentation.

Android Studio 3.2

The layout inspector is now found directly under tools. Tools > Layout Inspector

Android Studio 3

The layout inspector can only be found under Tools > Android > Layout Inspector

Android Studio 2.2

Instructions from original link on how to open the Layout Inspector:

To open the Layout Inspector, first launch your app on a connected device or emulator. Then open the Android Monitor window, select your device and app process, and then click Layout Inspector . You can also open it by clicking Tools > Android > Layout Inspector in the menu bar.

George Mulligan
  • 11,813
  • 6
  • 37
  • 50