Debug your app layout for augmented experiences with Layout Inspector

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

While you're building augmented experiences with Jetpack Compose Glimmer components for AI glasses, you can inspect and debug your layout with the Layout Inspector in Android Studio.

Turn off the embedded Layout Inspector

If you're running your app on virtual AI glasses devices with the Android XR Emulator, you need to turn off the embedded Layout Inspector:

  1. Open your project in Android Studio, and then navigate to Android Studio > Settings > Tools > Layout Inspector.

  2. Deselect Enable embedded Layout Inspector, and then restart Android Studio.

    Android Studio settings page for the Layout Inspector
tool.

Open the Layout Inspector

  1. In Android Studio, run your app.
  2. When you see a screen you want to inspect, select Tools > Layout Inspector from the menu bar.

    The Layout Inspector opens, along with the Layout Display and the Component Tree panel.

  3. From the Running devices drop-down menu, switch from the AI glasses AVD to the phone AVD that's acting as the host device.

    Layout Inspector view with the "Running devices" drop-down menu
highlighted.

  4. In the Layout Display, scroll past the UI layout for the phone AVD to find the UI layout for the AI glasses. Click elements here to inspect their attributes.

    Layout Inspector view showing the AI glasses UI in the Layout
Display.

Inspect layout attributes

As you interact with your app, inspect a view in the AI glasses UI 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.