Applicable XR devices This guidance helps you build experiences for these types of XR devices. [Learn about XR device types →](https://developer.android.com/develop/xr/devices) ![](https://developer.android.com/static/images/develop/xr/ai-glasses-icon.svg) Audio \&  
Display Glasses [](https://developer.android.com/develop/xr/devices#audio-display) [Learn about XR device types →](https://developer.android.com/develop/xr/devices)

<br />

As you test your app, use the Android XR Emulator to extend your testing
capacity beyond your physical test devices. You can use the emulator controls to
help you test how your app behaves in common scenarios with audio glasses and
display glasses. See the following sections for details about running your
[virtual Android XR devices](https://developer.android.com/develop/xr/jetpack-xr-sdk/run/create-avds/glasses) in the emulator and the emulator controls you
can use.

> [!IMPORTANT]
> **Important:** Check that you're using the latest Canary build of Android Studio. Other versions might not include Android XR tools. For more information, see [Install and configure Android Studio for XR development](https://developer.android.com/develop/xr/jetpack-xr-sdk/get-studio).

[![](https://developer.android.com/static/images/picto-icons/plus.svg) See also If this your first time using an emulator with Android Studio, review the Android Emulator documentation.](https://developer.android.com/studio/run/emulator)

## Run your app on the emulator

To run your app on the emulator, follow these steps:

1. In the Android Studio **Device Manager** , find the [phone AVD that you
   created](https://developer.android.com/develop/xr/jetpack-xr-sdk/run/create-avds/glasses#phone-avd-host-device) to act as a host device for the glasses AVD, and click **Start**
   .

   ![Click](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/phone-avd-start.png)
2. In the Android Studio **Device Manager** , find the [glasses AVD that you
   created](https://developer.android.com/develop/xr/jetpack-xr-sdk/run/create-avds/glasses#create-avd) and click **Start**.

   ![Click](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/ai-glasses-avd-start.png)
3. To launch your app in the emulator, select the **phone AVD** from the target
   device drop-down menu in the Android Studio main toolbar, and then click
   **Run**.

   ![Android Studio run app configuration](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/phone-avd-run-app.png)

## Use emulator controls for glasses

Use the emulator controls to help you test how your app behaves in common
scenarios with audio glasses and display glasses. See the following sections for
details on each of the controls you can use.

### Provide touchpad input

Because audio glasses and display glasses don't have a touchscreen, interactions
use a touchpad on the physical device. For the Android XR Emulator, you can find
the touchpad just below the display area.

Use your computer's mouse within the touchpad area to simulate touch, and enable
**Two Finger** mode to perform two-finger gestures.

The right side of the emulator touchpad area represents the area on a real
device that is towards the front of the glasses (where the lenses are), while
the left side represents the area on a real device that is towards the back of
the glasses (where the glasses rest on your ears). Knowing this orientation is
important when simulating gestures such as swiping forward or backward.
![](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/emulator-ai-glasses-touchpad.png) **Figure 1.** The touchpad area on the Android XR Emulator is just below the display area.

### Provide voice input

To toggle the microphone, select **Microphone** from the emulator controls. This
connects and sends input to the emulator using the default microphone input
device from your computer. This has the same effect as using the **Virtual
microphone uses host audio input** option in the [emulator extended
controls](https://developer.android.com/studio/run/emulator-extended-controls#microphone).

While the microphone is on, speak to use hotwords and issue commands.
![](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/emulator-ai-glasses-microphone.png) **Figure 2.** Enable the microphone to use your computer's microphone to provide voice input.

### Simulate audio glasses

While you test your app for display glasses, you'll need to simulate a pair of
audio glasses so that your app can [support both audio glasses and display
glasses](https://developer.android.com/develop/xr/jetpack-xr-sdk/glasses/support-different-types).

To help you test for these use cases, the Glasses app lets you
enable *Audio-only mode*:

1. In the phone emulator, open the Glasses app.

   ![The app icon for the Glasses app.](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/glasses-companion-app.png)
2. Tap **Device Settings** , and then toggle **Audio-only mode**.

   ![Toggle Audio-only mode through the Glasses .](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/companion-app-audio-only-mode.png)
3. Stop the phone emulator and the glasses emulator.

4. In the Android Studio **Device Manger** , find the phone AVD and click **Cold
   Boot** in the overflow menu.

   ![Click](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/phone-avd-cold-boot.webp)

   > [!IMPORTANT]
   > **Important:** You must close and relaunch the phone emulator **with a cold
   > boot** each time you toggle Audio-only mode on or off.

5. Follow the other steps to
   [relaunch the glasses emulator and run your app](https://developer.android.com/develop/xr/jetpack-xr-sdk/run/emulator/glasses#run-app-emulator).

### Disable the display snooze timeout

Display timeout behavior is an important consideration when developing your
app's experiences for audio glasses and display glasses. For this reason, we
recommend leaving the default behavior while performing your usual app testing.
However, for cases where the display timeout interferes with your testing, you
can disable the default behavior using the following ADB command:

    adb shell dumpsys activity service com.google.android.glasses.core/com.google.android.projection.core.app.service.AndroidProjectionCoreService preferences_set pref_automatic_snooze_timeout false

To restore the default display timeout behavior, run the following ADB command:

    adb shell dumpsys activity service com.google.android.glasses.core/com.google.android.projection.core.app.service.AndroidProjectionCoreService preferences_set pref_automatic_snooze_timeout true

### Use Gemini Live

Follow these steps to trigger Gemini Live in the glasses emulator:

1. Before you try and use Gemini Live, update the Google app to the latest
   version (minimum required version is 16.46.63) on the phone emulator:

   1. On the phone emulator, open the Google Play Store app.
   2. Search for "Google" and select the Google app.

      ![Update the Google app from the Google Play Store app.](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/ai-glasses-phone-avd-update-google-app.png)
   3. Select **Update**.

2. Trigger Gemini Live from the glasses emulator, by touching \& holding the
   touchpad for about 2 seconds.

   The first time, this will trigger a set of permission requests on your phone
   emulator. Grant all the required permissions, and then touch \& hold the
   touchpad on the glasses emulator for about 2 seconds again.

   ![Accept all the required permissions to use Gemini Live on the glasses
   emulator.](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/ai-glasses-gemini-live-permission-request.png)

   When Gemini live is active and listening, you'll see this on the glasses
   emulator:

   ![A visual indicator shows on the display when Gemini Live is active.](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/ai-glasses-gemini-live-active.png)
3. Check that the host microphone input is active on the glasses emulator by
   looking at the phone emulator. You should see a notification like the
   following one:

   ![A notification on the phone emulator indicates that the host microphone
   input is active.](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/ai-glasses-check-host-microphone.png)

> [!NOTE]
> **Note:** If you encounter issues while using Gemini Live, see the [troubleshooting
> steps](https://developer.android.com/develop/xr/jetpack-xr-sdk/run/emulator/glasses-troubleshoot#issues-gemini-live).

### Use custom environments

You can test using photos of real environments (including still 2D images and
360-degree panoramic images) or webcam camera input to help you evaluate how
your augmented experiences would render in those scenarios using [Jetpack
Compose Glimmer](https://developer.android.com/develop/xr/jetpack-xr-sdk/jetpack-compose-glimmer).

While the [default theme](https://developer.android.com/develop/xr/jetpack-xr-sdk/jetpack-compose-glimmer/whats-included#theme) is pre-optimized for light and dark environments,
brand-specific customizations require careful re-testing. Test carefully so that
your UI maintains high visibility and contrast on optical see-through displays,
regardless of the user's environment.

To use a custom still image or webcam camera input as the background within the
emulator:

1. Select **Environments** from the emulator controls.
2. In the drop-down menu, select **Custom Environment** for custom, uploaded
   images, or **Camera** for webcam camera input.

   ![Select a custom photo environment image or webcam camera input in Android
   Studio.](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/display-glasses-environment-camera-input.jpg)
3. For custom environments, pick an image to use or select a previously-used
   image from the **Recent Environments** list.

   ![While you preview your app's UI, the custom environment appears in the
   background.](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/display-glasses-custom-environment.png)

#### 360-degree panoramic photo environments

The emulator supports standard equirectangular panoramas in JPG or PNG formats.
360-degree photos let you test your glasses apps in a more realistic backdrop
where movement and head rotation play a role in evaluating glanceable UI
elements.

To rotate your view in the environment, hold the `Shift` key while using your
mouse or your keyboard's arrow keys.

### Capture a screenshot

To capture the visual output of your app running within the emulator, you can
take screenshots.

To do this, click **Take screenshot** in the emulator controls.
![Use the emulator controls to capture a screenshot of the emulator display in Android Studio.](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/capture-screenshot.png)

This functions the same as taking screenshots for other virtual devices in the
Android XR Emulator, and saves the captured screenshot as a PNG file.

### Capture a screen recording

To capture a screen recording of your app running within the emulator:

1. Click **Record Screen** in the emulator controls.

   ![Use the emulator controls to capture a screen recording of the emulator
   display in Android Studio.](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/run/capture-recording.png)
2. Select "Show taps" if you want to highlight user interactions.

3. After you've captured what you need, click **Stop recording**.

   A preview appears, and you can save the file to your computer.

### Capture photos or videos

Camera capture features in the Android XR Emulator aren't available yet.

### Enable the display snooze timeout

By default, the display on the emulator doesn't snooze while you develop and
test your app. However, display timeout behavior matters when you design
experiences for real display glasses. Due to the strict battery and thermal
constraints on display glasses, you should optimize power consumption so that
users can engage with their devices for as long as possible. Enable the display
snooze timeout and test your app so that you can observe real-world device
behavior and adjust your app accordingly.

To enable the display timeout, run the following ADB command:

    adb shell dumpsys activity service com.google.android.glasses.core/com.google.android.projection.core.app.service.AndroidProjectionCoreService preferences_set pref_automatic_snooze_timeout true

To restore the default behavior with no timeout, run the following ADB command:

    adb shell dumpsys activity service com.google.android.glasses.core/com.google.android.projection.core.app.service.AndroidProjectionCoreService preferences_set pref_automatic_snooze_timeout false