Setup KVM and Open GL emulation on Ubuntu 14.04 for Android 5.0 emulator

I wanted to speed up my Android Emulator on my i5 desktop PC to try Android 5.0 Lollipop
I created a x86 AVD running Android 5.0 (I could not manage to use a x86_64 image as it was either slow or crashing)

KVM

Intel processor seems to be required for now

First check if KVM can be used

$ sudo apt-get install cpu-checker
$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

otherwise check your BIOS to enable KVM

I then simply append -qemu -enable-kvm to the command line (it has to be the last option) I use to start my emulator

Open GL

Make sure use Host GPU is checked in the your AVD or append -gpu on to your emulator command line

To solve the following issue:

Could not load OpenGLES emulation library: lib64OpenglRender.so: cannot open shared object file: No such file or directory

Here the solution is to add the tools/lib directory to LD_LIBRARY_PATH

My final command line, assuming ANDROID_SDK point to you android sdk installation (in my case: /opt/apps/android-studio/sdk)

LD_LIBRARY_PATH=${ANDROID_SDK}/tools/lib ${ANDROID_SDK}/tools/emulator64-x86 -avd Nexus4_5_0_x86 -scale 0.70 -qemu -m 2048 -enable-kvm

Popular posts from this blog

Soving AccessDenied on Google Cloud Storage domain mapping

Fixing "DerInputStream.getLength(): lengthTag=109, too big" in Android Studio

Simple Samba setup on Lubuntu