Using Android 8 and 9 emulators without Android Studio

Despite Google’s efforts to deprecate the Android SDK Manager standalone GUI in an attempt to force the installation of Android Studio, which is irrelevant for Cordova apps, you can still run any Android emulator without Android Studio using the updated SDK Manager tools. This process involves installing the SDK tools 24 and then updating them to version 27 with the provided links.

android sdk manager tools gui

Android SDK manager can be used to get and update your Android APIs easily.

Symptoms

  • Your Android 8.x and 9.x system images (API 26 and newer) refuse to start.
  • OR you want to use the latest Android SDK API level and emulators with Visual Studio (for Windows) instead of its obsolete built-in SDK
  • OR you receive any of these errors on emulator startup:

ERROR: This AVD’s configuration is missing a kernel file! Please ensure the “kernel-qemu” is in the same location as your system image.

ERROR: ANDROID_SDK_ROOK is undefined

“To Start Android, enter your password” dialog on startup followed by “Decryption Unsuccessful” message

kernel-quemu ANDROID_SDK_ROOT

Errors starting Android Emulator API 27 with SDK tools 24.

Causes

Starting from API 26 (Android 8.0.0) and onwards, system images are incompatible with the aging Android SDK tools version 24 and will throw all kind of startup errors or refuse to run.

If you have already updated the Android SDK tools to version 27 or newer and still get emulator related errors, please keep reading to ensure your emulators have been setup properly and according to your hardware.

If you are using Visual Studio 2015 or 2017 with Tools for Apache Cordova and want to use the latest SDK instead of using the obsolete API25 and emulators provided by Visual Studio, set your ADT_HOME path to the location where you have installed the SDK using the following instructions. This path can be set in Tools > Options > Tools for Apache Cordova.

Resolution

Update your Android SDK Emulator

Update your Android SDK emulator to version 27 or newer. Do not use the SDK tools from Android Developers downloads, these won’t work with the SDK GUI tools, as they are all command line executables only.

  1. If you don’t have Android SDK tools 24.4.1 already, download and install it. This is the last version that features the standalone SDK Manager and AVD Manager GUI apps, before the release of Android Studio.
    1. Windows: android-sdk_r24.4.1-windows.zip
      1. Installer version: installer_r24.4.1-windows.exe
    2. MacOS: android-sdk_r24.4.1-macosx.zip
    3. Linux: android-sdk_r24.4.1-linux.tgz
  2. Get the updated Android SDK emulator 27.3.8 for your platform: (*)
    1. Windows: emulator-windows-4848055.zip
    2. MacOS: emulator-darwin-4848055.zip
    3. Linux: emulator-linux-4848055.zip
  3. Uninstall your current Android 8 and newer System Images.
  4. Close your Android SDK Manager and AVD Manager tools if open.
  5. Extract the contents from the ZIP file into your android-sdk/tools:
    1. Windows: The ZIP file contains a tools folder that must be copied over your current android-sdk/tools folder.
    2. MacOS: The ZIP contains an emulator folder that must be merged with your android-sdk/tools folder. Do not use the Apply to all folders option when copying contents from the ZIP to the tools dir.
  6. Launch SDK manager and check if the version in the About dialog is latest.

The emulator linked here was released on July 9, 2018. Check out the release notes for more info.

(*) Some links here have been taken from this StackOverflow post by the user xavier_fakerat, make sure to kindly upvote his answer there.

Download System Images and create Android emulator

After updating your SDK Manager, follow these steps to create your API26 or API27 emulators.

  1. Download the desired emulator’s System Images from the SDK Manager.
  2. Create a new emulator from the AVD Manager with these settings:
    1. Target: Android 8.1.0 or 9.x
    2. CPU/ABI: Google APIs Intel Atom. Using Google APIs system images instead of regular ones provides access to all Firebase and Google Play Services APIs and libraries.
    3. Activate Hardware keyboard present
    4. RAM: At least 1024 MB, VM Heap at least 256 MB.
android 8.1.0 emulator settings

AVD settings for Android 8.1.0 emulator.

Notices and Warnings

Memory Considerations

The higher the API level, the greater the emulator’s RAM requirements will be.

  • Setting RAM too low will cause the emulator to either fail to start, or start but never end booting. Use at least 1024 or 2048 MB for API26 images.
  • Setting RAM to a value higher than your system’s capacity will fail to start the emulator with these errors:

Failed to register RAM block: va=0x93340000, size=0x100000000, method=legacy
VCPU shutdown request

Error starting emulator when you don’t have enough RAM.

  • Emulator’s first boot seems to require more RAM. If you create an emulator with 512 MB for the first time, it might never end booting and hang. If you create it with 2048 MB, start it up, then close it, you may be able to run it with as little as 512 MB from now on, to a certain extent.  (All RAM values here refer to the AVD’s assigned RAM!)

If your emulator fails to start or strange Play Services errors popup randomly, try increasing RAM and VM heap values. With a physical 8GB of RAM you can easily assign 2048 MB if running Windows 8.1 or Windows 10, and still have plenty of RAM available for other applications. If you need to increase RAM to higher values and you get the Failed to register RAM block error, restart your computer and don’t open anything but the emulator first. If this still doesn’t work you’ll need to expand your physical RAM.

Requirements for Intel Processor Users

Intel inside logo

On Intel x86-based computers, the Android Emulator uses Intel HAXM by default. Intel HAXM is a mature and open-sourced hypervisor solution developed by Intel. Thanks to on-going development by Intel, the fastest emulator performance on Windows is still with Intel HAXM. To download the latest Intel HAXM, refer to the official guides at GitHub:

Requirements for AMD Processor Users

AMD Ryzen processors

AMD processor users will need to pay attention to additional requirements and recommendations:

  • AMD Processor – Recommended: AMD® Ryzen processors
  • Android Emulator v27.3.8+ (linked on this page)
  • x86 Android Virtual Device (AVD)
  • Windows 10 with April 2018 Update
  • Windows Hypervisor Platform enabled in Windows Features
Windows Hypervisor Platform setting in Windows 10

Windows Hypervisor Platform setting in Windows 10.

After taking care of the above settings, you’ll be able to run API 26 and newer emulators on your AMD based computer with latest speed and resources usage improvements.

AMD Android Emulator

Android Emulator running on Windows 10 with AMD Processor Screenshot Configuration: Asus ROG Strix GL 702ZC, Processor: AMD® Ryzen™ 7 1700 Processor, Chipset: AMD 5350, Graphics: AMD® Radeon™ RX580.

Reporting Bugs in the Android SDK tools

If you find an issue that impacts one of the Android Developer tools, such as Android Studio, SDK, Emulator, System Images, or Support Library, you can file a bug in one of these components.

Other issues with the Android emulator

If you have other problems with your Android emulator, feel free to post your issue in full detail in the Comments section below. You may receive feedback from me or other fellow developers to help you with your particular case.

All product names, logos, and brands in this website are property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.