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:
Open your project in Android Studio, and then navigate to Android Studio > Settings > Tools > Layout Inspector.
Deselect Enable embedded Layout Inspector, and then restart Android Studio.
Open the Layout Inspector
- In Android Studio, run your app.
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.
From the Running devices drop-down menu, switch from the AI glasses AVD to the phone AVD that's acting as the host device.
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.
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.