Installing ARCore on Android Emulator - samrg123/JniTeapot GitHub Wiki

Installing ARCore on Android Emulator

Table of contents:

  1. Setting up an AVD
    1.1 Creating a Virtual Device
    1.2 Configuring the Virtual Device

  2. Installing ARCore

  3. Launching JniTeapot

  4. References


Section 1: Setting up an AVD

In this section we will create a Android Virtual Device and configure it to be compatible with ARCore v1.19.0.

2.1 Creating a Virtual Device

To create an Android Virtual Device (AVD) click on the AVD dropdown menu in Android Studio and select "Open AVD Manager":

Next select "Create Virtual Device" on the bottom of the popup:

Select "Pixel 3a" from the list of available devices and click "Next":

2.2 Configuring the Virtual Device

You should now be prompted to select a system image to use with the device. As of writing this the only configuration compatible with ARCore is an x86 image of Android Q (API 29) with Google APIs installed.

Click on "x86 Images" tab on the top of the screen, select the Android Q API 29 x86 image with Google APIs and click "Next":

Note: It is important to emphasize that ARCore will NOT work with if a "Google Play" image is used. Make sure you select the "Google APIs" image when configuring the AVD.

To use ARCore with an AVD its back camera must be configured to use a VirtualScene. To ensure this is the case click on "Show Advanced Settings":

Select "VirtualScene" from the back camera dropdown and click "Finish":


Section 2: Installing ARCore

Congratulations! You've just finished setting up an AVD for ARCore. Now all thats left to do is to install ARCore on it.

You can find a copy of the ARCore apk under the 'JniTeapot/app/src/cpp/arcore1.19.0' folder or download a copy of it here or directly from Google:

To install ARCore on the AVD, first launch the device by double clicking on it from the AVD Manager:

Then open the Terminal window in Android Studio by clicking on the "Terminal" tab at the bottom of the screen:

Type in or copy the following command making sure to fill in the appropriet path to the ARCore apk:

adb install "[PATH TO ARCORE]"

Hit Enter and if everything goes well you should be greeted with the following message:

And There you have it! You've successfully installed ARCore on the AVD!


Section 3: Launching JniTeapot

To test whether or not ARCore is working you can try launching the JniTeapot project. To do this make sure you AVD is selected in the AVD dropdown:

And click on the "Run" button located at the top of the screen:

The first time you run JniTeapot you will be asked to allow access to the Camera. Go ahead and click "Allow":

And Viola! If ARCore is the AVD is setup correctly and ARCore is installed you should be greeted with a sphere floating in the middle of the virtualScene:


Section 4: References

  • You can find a the Google wiki used for this guide here
  • For the latest version of ARCore for Android Emulator and information about how to install click here