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:
Android Studio 3.1 or later.
Android Emulator 27.2.9 or later.
Get Android Studio and SDK tools for ARCore
Install Android Studio 3.1 or later.
In Android Studio, go to Preferences > Appearance and Behavior > System Settings > Android SDK.
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.Select the SDK Tools tab and add Android Emulator 27.2.9 or later.
Click OK to install the selected packages and tools.
Click OK again to confirm changes.
Accept the license agreement for the Component Installer.
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)
In Android Studio open the Device Manager by clicking Tools > Device Manager.
Click Create Device, at the top of the Device Manager panel.
Select or create your desired Phone hardware profile and select Next.
Select an
x86
orx86_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.
Verify that your virtual device is configured correctly:
Click Show Advanced Settings.
Make sure that Camera Back is set to VirtualScene.
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:
Download the latest Google_Play_Services_for_AR_1.46.0_x86_for_emulator.apk from the GitHub releases page.
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.46.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 Shift to access camera movement controls. Use the following controls to move the camera:
Action | What to do |
---|---|
Move left or right | Hold Shift + press A or D |
Move down or up | Hold Shift + press Q or E |
Move forward or back | Hold Shift + press W or S |
Change device orientation | Hold Shift + move mouse |
Release Shift 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/libarcore_c.so" 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.