To get started developing for Android XR, we recommend using the latest Canary version of[Android Studio](https://developer.android.com/studio/preview), which includes new tools and updates optimized for Android XR.
| **Note:** Verify you are using the latest Canary build of Android Studio. Other versions might not include Android XR tools.

New features included in this version of Android Studio are:

- Android XR Emulator
- Addition of XR support in the Layout Inspector
- XR Project template

## System Requirements for Android XR Emulator

**For macOS:**

- **OS**: macOS 13.3 or later.
- **CPU/GPU**: Apple Silicon (M1 chip or newer)
- **RAM/VRAM**: 16 GB or higher

**For Windows:**

- **OS**: Windows 11 or later.
- **CPU**: Intel 9th generation or later, or AMD Ryzen 1000-series or later.
- **RAM**: 16 GB or higher
- **GPU**: NVIDIA GeForce 10 series or later, or AMD Radeon RX 5000 series or later.
- **VRAM**: 8 GB or higher
- **BIOS Settings**: VMX CPU extensions must be enabled in your computer's BIOS

| **Note:** You can check if the VMX CPU extensions are already enabled by attempting to run the 2D Android Emulator. If it runs successfully, no BIOS changes are needed.

## Install and configure Android Studio for XR development

Complete the following steps to download Android Studio and set up your development environment:

1. Make sure to close any versions of Android Studio you already have installed.

2. Download the latest Canary build of[Android Studio](https://developer.android.com/studio/preview), extract it into your preferred location, and launch the application.

3. Follow the installation instructions in the wizard.

4. In the**Welcome to Android Studio** dialog, click**More Actions** , and select**SDK Manager**.

   ![Android studio welcome screen](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/setup/welcome.png)
5. In the**Android SDK** page, click the**SDK Tools**tab and select the following tools to install:

   - Android SDK Build-Tools
   - Android Emulator
   - Android SDK Platform-Tools
   - Layout Inspector for API 31 - 36

   ![Android studio sdk screen](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/setup/sdk-tools.png)
   | **Note:** If you had a previous version of Android Studio installed, you may need to recheck these boxes, and click**Apply**to download the latest updates.
6. Under the**SDK Platforms**tab, do the following:

   1. Select the**Show Package Details**checkbox to see all the options.
   2. Select the**Google Play XR ARM** system image (macOS) or**Google Play XR Intel x86_64**(Windows).

   ![Android studio sdk platform screen](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/setup/sdk-platform.png)
   1. Click**Apply** to make the updates, and then click**OK**.
   2. Allow all the installation steps to complete, then click**Finish**.

## Create an Android XR project

Follow these steps to create an Android XR project in Android Studio or extend an existing project to XR.

1. In the**Welcome to Android Studio**window, do one of the following:

   1. If you're creating a new XR app, click**New Project**and go to the next step.
   2. If you're spatializing an existing app, click**Open** to select your project, then skip to the next step Create a new Android Virtual Device for the Android Emulator. (For help with spatializing your existing app for Android XR, read[Bring your Android app into 3D with XR](https://developer.android.com/develop/xr/jetpack-xr-sdk/add-xr-to-existing))

   ![Android studio welcome screen](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/setup/welcome-2.png)
2. In the**XR** category, select the**Basic Headset Activity** template and click**Next**.

   ![Android studio new project screen](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/setup/new-project.png)
3. On the next screen you can choose a name for your project. You can leave the default settings in place. Then click**Finish**.

4. Explore the code provided in the template. Check out our[development guide](https://developer.android.com/develop/xr/jetpack-xr-sdk/develop-ui)and[reference documentation](https://developer.android.com/jetpack/androidx/releases/xr-compose).

## Create a new Android Virtual Device for the Android Emulator

The Android XR Emulator is a specialized version of the Android emulator designed for XR app development. It lets you test and debug your Extended Reality (XR) applications within the familiar Android Studio environment.
| **Caution:** In rare cases, using the emulator can result in system freezes or crashes on some Windows configurations. Save all your data before running the emulator. As a workaround,[enable WHPX](https://developer.android.com/studio/run/emulator-acceleration#vm-windows-whpx). See[release notes](https://developer.android.com/studio/preview/features)for more known issues.

To use the Android XR Emulator, you'll have to create a new virtual device. Follow these steps to do so:

1. In Android Studio, click**Tools \> AVD Manager**, and follow the instructions to create a new Android Virtual Device (AVD).

   ![Android studio device manager screen](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/setup/device-manager.png)
2. In the**Add Device** window, under**Form Factor** , select the**XR** option, then select the appropriate**XR Device** from the**Name** list. Click**Next**.

   ![Android studio add device screen](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/setup/add-xr-device.png)
3. In the next tab (**Configure Virtual Device** ), under**System Image**, select the most recent Android XR system image that is compatible with your system.

   ![Android studio configure android virtual device screen](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/setup/configure-avd.png)
4. Click**Finish**.

5. To start the emulator, click the**Run**button in Device Manager.

   ![Android studio device manager screen](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/setup/device.png)

   The emulator opens in the side panel.

   ![Android studio emulator screen](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/setup/emulator-screen.png)
6. To launch your app in the emulator, click the**Run**icon in Android Studio.

   ![Android studio run application UI](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/setup/xr-device.png)

For details on using the emulator and other new XR tools, read[Android Studio Tools for XR](https://developer.android.com/develop/xr/jetpack-xr-sdk/studio-tools).

## Enable Usage Statistics to help improve Android Studio

Because this is a developer preview version of Android Studio, many of these features are still under development. Consider enabling usage statistics and sending feedback to help us improve these tools.

To enable Usage Statistics:

1. Click**Settings \> Appearance \& Behavior \> System Settings \> Data Sharing**.
2. Select**Send usage statistics**.

   ![Android studio settings screen](https://developer.android.com/static/images/develop/xr/jetpack-xr-sdk/studio-tools/studio-data-sharing-settings.png)