With the release of the Android 11 Developer Preview, we’ve also released the Android 11 OS image. The new system image provides significant performance improvements in executing ARM binaries. Previously, developers who relied on the ARM libraries and were unable to build x86 versions of their applications could only use a full ARM simulation system image (which is much slower than running an x86 system image on an x86 device) or a physical machine. The Android 11 system image can directly convert ARM instructions into x86 instructions without affecting the entire system. Developers can execute ARM binaries and test them without having to build a high-load ARM environment.
The technical details
We may need to illustrate the importance of this new technology in context, especially if you are building applications using only Kotlin or the Java programming language. Unlike Kotlin and the Java programming languages, which execute on ART (the Android runtime), C++ compels all C++ instructions in Android applications directly to machine instructions, meaning that the platform architecture of the target device determines how C++ is compiled. Mobile phones typically run on ARM processors, so many of the C++ dependencies you add to your application, such as the camera barcode scanning library, are arm-only compatible. In this case, if you are developing on an x86 processor-based device, your application will not run.
In the past, developers needed to build a complete ARM environment from an emulator mirror system image to get around this limitation and execute ARM applications on x86 machines. However, converting the entire system’s ARM instructions into x86 instructions imposes an excessive performance overhead, so a complete ARM system image will run much slower on an x86 host than an X86-based system image. And it doesn’t take advantage of the hardware acceleration and CPU virtualization that x86 processors offer.
The new Android 11 system image is arm-compatible, allowing the entire system not only to run x86 instructions natively, but also to use virtualization as usual. When an application process needs to use ARM binaries, the code is only converted to x86 instructions within that process, and the rest of the process continues to execute within the x86 environment, including the Android Runtime (ART) and other performance-critical libraries such as libGLES and libvulkan. In addition, the instruction converter does not execute low-level hardware-specific libraries, avoiding costly memory access detection and the corresponding performance impact. In collaboration with ARM, the new simulator system image runs both locally and within a continuous integration framework.
The next step
If you’ve previously opted for a physical machine over an emulator due to a lack of high-performance ARM support, try the Android 11 system image. The image file is now available for download with the Android 11 Developer Preview. You can download the latest version of the system image to Android Studio through the SDK Manager or Android Virtual Device Manager.
Once your application runs successfully in the emulator, consider adapting to Chrome OS. Chrome OS also supports ARM versions of Android apps on x86 laptops. By building apps for Chrome OS, you can tap into the vast opportunities in the big-screen device ecosystem and make your apps available to a wider audience around the world.
This technology could help more developers test on Android emulators. We recommend that developers build both x86 and ARM ABI versions of their applications to run optimally on physical devices and appeal to as many users as possible. Going forward, we plan to popularize the technology at multiple API levels, while ensuring that it supports all test cases as well as physical machines. We welcome your feedback to help us further refine this new technology.
Please note: ARM – x86 instruction conversion technology can be used to execute ARM products. The technology is available only through the Google API and The Play Store system image, and is only used for application development and debugging on x86 desktops, notebooks, client-side local servers, or self-purchased cloud environments. This technique is not available under commercial hosting services.
Java is a registered trademark of Oracle and/or its affiliates.
Click here toLearn more about the Android 11 system image