Saturday, September 16, 2017

Emulators Cyanogenmod and Android

Emulators Cyanogenmod and Android


When developing Android applications, the Android emulator may be useful for testing, because it provides better debugging support or devices are not available. The Android emulator is based on the QEMU machine emulator and supports MIPS, ARM and x86 architectures. Currently, most Android devices are ARM-based, but because of performance issues with emulating ARM on the host PC, the x86 variant is commonly used for testing applications. The x86 emulator can use the host processors virtualization extensions, which greatly increases performance.

Android platform changes may also be suitable for testing in the emulator. The Android Open Source Project provides simple instructions for building and testing on an emulator. Since Android supports various mobile devices and due to their variety, the build is device-dependent, and the emulator is technically just another device.

In comparison, the cyanogenmod.org wiki currently doesnt provide specific instructions on building for the emulator, such as it does for the supported devices. Nevertheless, the old wiki has a page describing precisely this, but it is slightly outdated. Although the build process is very similar to the official AOSP one, some users were reporting various problems with the build. The problems seem related to compatibility of the kernel with the emulator, and may have been resolved in the meantime, although I cant find recent success reports online. The build system does provide a device target full which refers to the emulator debug image as in Googles AOSP build instructions, so it appears that the only relevant information about whether it currently works on the emulator can be seen by testing it:
I succeeded in building the cyanogenmod image from source and ran it on the emulator. It should be noted that at that time, in two most recent code branches (corresponding to android releases 4.1 and 4.2) the build failed when targeting an x86 system (for example, sometimes there was inline ARM assembly in some sources), but finished normally for ARM targets. The build system is set up  so that once the image is build, the emulator can be launched for it directly.


download file now