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 simulated environment with a simulated device that you control.

Requirements

See the Android Emulator requirements to determine if your system supports the emulator.

You'll also need Android Studio 3.1.

Get Android Studio and SDK tools for AR

  1. Install Android Studio 3.1.

  2. In Android Studio, go to Tools > Android > SDK Manager. By default, the System Settings > Android SDK menu opens.

  3. In the Android SDK menu, select SDK Platforms and click Show Package Details.

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

  4. In the Android SDK menu, select SDK Tools and add Android Emulator (Version 27.1.10).

  5. Click OK to install the tools.

Create a virtual device with AR support

AR is supported by default in new virtual devices created in Android Studio 3.1, with the API Level 27 Revision 4 system image.

You can follow the Android Studio instructions to Create a Virtual Device with AR support.

Configure the virtual device

  • Select the Pixel or Pixel 2 hardware profile.
  • Select the Oreo: API Level 27: x86: Android 8.1 (Google APIs) system image.
  • Confirm that your virtual device is configured correctly:

    • Go to Verify Configuration > Show Advanced Settings.
    • Make sure that Camera Back is set to VirtualScene.

      If it is not, go back and make sure that you are running Android Studio 3.1 and have Android Emulator 27.1.10 installed.

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 ARCore (optional)

The version of ARCore on the emulator may be out-of-date. Follow these instructions to update it:

  1. Download ARCore x86 for emulator APK from github.

  2. Drag the downloaded apk onto the running emulator (or run adb install -r ARCore_1_1_x86_for_emulator.apk to install from the terminal).

Control the AR Simulation

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 simulated device

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

Platform Action What to do
OSX 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.

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.

Send feedback about...