Thanks for tuning in to Google I/O. Check out the sessions.

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 the appropriate Android version select:
    Google APIs Intel x86 Atom System Image API Level 27 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.

  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.37.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 from your system folder (i.e., Downloads) onto the running emulator, or install it using adb while the virtual device is running:

    adb install -r Google_Play_Services_for_AR_1.37.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 a "This device does not support AR" message, check the revision on your system image. Make sure you are using API Level 27 Revision 4 or later.

  • 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.

  • If your ARCore app fails to open with the error message "Failed to create AR session" check the app log. If you find a java.lang.UnsatisfiedLinkError with a message that contains /lib/arm/" is for EM_ARM (40) instead of EM_386 (3), you may have installed the wrong version of the Google Play Services for AR apk. Create a new virtual device and install the x86 version.