Debug your app layout for immersive experiences with Layout Inspector

Applicable XR devices
This guidance helps you build experiences for these types of XR devices.
XR Headsets
Wired XR Glasses

While you're building immersive experiences for XR headsets and XR glasses with spatial panels and orbiters, you can inspect and debug your layout with the Layout Inspector in Android Studio.

Open the Layout Inspector

  1. In Android Studio, run your app.
  2. After app deployment has completed, select Tools > Layout Inspector from the menu bar.

    The Layout Inspector opens, with the Layout Display on the left and the Component Tree panel on the right.

    Spatial UI elements such as orbiters and panels appear as separate objects beneath the main content.

    Android Studio window with the Layout Inspector
open.

Inspect layout attributes

As you interact with your app, inspect a view by clicking it in the Layout Display or in the Component Tree. All of the layout attributes for that view appear in the Attributes panel. For example in the following image, the attributes are shown for the AndroidComposeView spatial panel that is labeled "More articles":

Android Studio window with the Layout Inspector open and the Attributes panel visible.
Figure 1. See a view's layout attributes by clicking it.