Does Android Studio Have a Hierarchy Viewer or Layout Inspector

Does Android Studio have a Hierarchy Viewer or Layout Inspector?

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.

Hierarchy Viewer is gone

Latest build tools (25.3.0) removes hierarchy viewer.

http://tools.android.com/recent/androidsdktoolsrevision2530feb2017

Android: Hierarchy Viewer doesn't exist

Can't comment, no rep.

After updating to the latest build tools, hierarchy viewer and a bunch of other stuff was removed from the tools directory. I downloaded the tools separately from the Android Studio download page and it included the hierarchy viewer. Not sure what's going on, but it seems updating build tools in Android Studio removes the hierarchy viewer.

Edit: Hierarchy viewer is listed under the deprecated features from Build tools 25.3.0

http://tools.android.com/recent/androidsdktoolsrevision2530feb2017

In Android Studio, how can I get the Layout Inspector to display more complex views?

I found an unorthodox solution: Layout Inspector sometimes works when the app is sent to the background. The views will be shown as inactive, but it will still be possible to see their properties.

How to use Layout Inspector to inspect Notification View?

Ok, I found the solution:

  • Start emulator and expand status bar
  • In Layout Inspector select
    process com.android.systemui

Now we have access to notification
views.

Create a layout inspector *.li file with Android Studio 4.0

I found one solution for the above case. You need to type shift two times and then type legacy layout inspector. The old layout inspector will open and you can save its .li file.

I found it useful because I can do it in the Android Studio 4.0.
I can use new feature from Android Studio 4.0 Layout Inspector as well can save .li file using the legacy layout inspector.

How do I inspect the layout of an Alert Dialog using Layout Inspector?

I had the same issue. (I'm using Android Studio Arctic Fox 2020.3.1 patch 3)

Turned out the inspector by default filters out System-defined layers, and the dialog is one. There's this small button in the layout inspector, which looks like a filter.

Click it, disable the "Filter system defined layers" and another layer appears.

Before:

Sample Image

After:

Sample Image



Related Topics



Leave a reply



Submit