Google is committed to advancing racial equity for Black communities. See how.

Run AR Apps in Android Emulator

Use the Android Emulator to test AR scenarios without a physical device. The Android Emulator lets you run ARCore apps in a virtual environment with an emulated device that you control.

Set up your development environment

Software requirements:

Get Android Studio and SDK tools for ARCore

  1. Install Android Studio 3.1 or later.

  2. In Android Studio, go to Preferences > Appearance and Behavior > System Settings > Android SDK.

  3. Select the SDK Platforms tab and check Show Package Details.

    Under Android 8.1 (Oreo), select:
    Google APIs Intel x86 Atom System Image API Level 27, version 4 or later.

  4. Select the SDK Tools tab and add Android Emulator 27.2.9 or later.

  5. Click OK to install the selected packages and tools.

  6. Click OK again to confirm changes.

  7. Accept the license agreement for the Component Installer.

  8. Click Finish.

Create a virtual device with AR support

For more information, see the Android Studio instructions to Create a Virtual Device.

Create a new Android Virtual Device (AVD)

  1. In Android Studio open the AVD Manager by clicking Tools > AVD Manager.

  2. Click Create Virtual Device, at the bottom of the AVD Manager dialog.

  3. Select or create your desired Phone hardware profile and select Next.

  4. Select an x86 or x86_64 system image running API Level 27 or later and select Next.

    • While physical ARCore devices are supported on API Level 24 or later, Android Emulator support requires API Level 27 or later.

    • Only x86-based Android Emulator architectures are supported. Other architectures such as arm64-v8a, armeabi-v7, are not currently supported.

    • macOS only with ARCore SDK 1.16.0 or later: Due to a known issue, Android Emulator x86_64 system images are not supported on macOS with ARCore SDK 1.16.0 or later. As a workaround, use an x86 system image.

  5. Verify that your virtual device is configured correctly:

    • Click Show Advanced Settings.

    • Make sure that Camera Back is set to VirtualScene.

  6. Click Finish to create your AVD.

Run your app

Test an ARCore app on an AR-supported virtual device in the emulator. To do this, you can follow the Android Studio instructions to Run an app in the Android Emulator.

Update Google Play Services for AR

The version of Google Play Services for AR on the emulator is likely out of date. Follow these instructions to update it:

  1. Download the latest Google_Play_Services_for_AR_1.20.0_x86_for_emulator.apk from the GitHub releases page.

  2. Install the downloaded APK into each AVD you'd like to use:

    Start the desired AVD, then drag the downloaded APK onto the running emulator, or install it using adb while the virtual device is running:

    adb install -r Google_Play_Services_for_AR_1.20.0_x86_for_emulator.apk

Repeat these steps process for any additional AVDs you'd like to use.

Control the virtual scene

When your app connects to ARCore, you’ll see an overlay describing how to control the camera and a status bar below the emulator window.

Move the virtual camera

Press and hold Option (macOS) or Alt (Linux or Windows) to access camera movement controls. Use the following controls to move the camera:

Platform Action What to do
macOS Move left or right Hold Option + press A or D
Move down or up Hold Option + press Q or E
Move forward or back Hold Option + press W or S
Change device orientation Hold Option + move mouse
Linux or Windows Move left or right Hold Alt + press A or D
Move down or up Hold Alt + press Q or E
Move forward or back Hold Alt + press W or S
Change device orientation Hold Alt + move mouse

Release Option or Alt to return to interactive mode in the emulator.

Use the Virtual Sensors tab in Extended controls for more precise device positioning.

Add Augmented Images to the scene

Load images into the emulator’s simulated environment to test Augmented Images.

Use the Camera tab in Extended controls to add or modify Scene images. There are two image locations, one on the wall and one on the table.

To view these image locations in the scene, launch your emulator, then move the camera to the dining room area through the door behind the camera’s starting position.

Troubleshooting tips

  • If your ARCore app launches and you see an "AR Core not supported" message, check the revision on your system image. Make sure you are using API Level 27 Revision 4.

  • If your ARCore app fails to open the camera when it launches, make sure that Camera Back is set to VirtualScene, as described in the configuration steps above.