4

It will be better if there's a step by step installation for android studio and qemu vm. Cause i'm going through hell trying to fix a lot of ish here. Tried umake android 'android-ndk' That's using ubuntu make but that didn't work so I did the old fashion way. Now having emulator ish and can't really use a real device cos it ain't working. Please anyone there that's ready to help me? Thanks.

11

Installing and using Android Studio on Ubuntu 16.04 is a task that needs a certain strategy and you need to follow certain steps.

  1. Your system must be equipped with a 64-bit CPU capable of supporting Hardware Virtualization and at least 4 GB of RAM but this will not be enough if you're planning to use other programs while Android Studio is running. In that case, 8 GB is a must. You must be using the 64-bit Ubuntu 16.04 of course.

  2. You need to install the Oracle JDK 8 and this can be done by adding the webupd8team java ppa to your system (sudo add-apt-repository ppa:webupd8team/java) and installing both oracle-java8-installer and oracle-java8-set-default.

  3. Install the complete KVM/qemu on your system by following the instructions given here.
    In the beginning, you will find instructions on how to check if your system's processor is ok for use with KVM. Don't forget to log off and back on after the installation, otherwise your user will not be activated as a member of the libvirtd group and you will not be able to use KVM.

  4. Download the latest Android Studio .zip file from the Android Developer's site and make sure you install the 32-bit support files listed over there. NOTE: The file lib32bz2-1.0 does not exist on 16.04, so you have to install libbz2-1.0:i386 instead, using sudo apt-get install libbz2-1.0:i386.

  5. Extract the contents of the .zip file in a folder of your choice and create a launcher for the studio.sh file you will find in the android-studio/bin folder and if everything else is ok, it should run fine.

You will need to install all the necessary libraries and images using the android SDK and create the AVD's you'll be using of course but I think you must know that already since you are a developer. In order for the emulator to actually use KVM, you must start it using these emulator parameters:

/pathTo/emulator -avd avd_name -qemu -m 1024 -enable-kvm

Update: The command above has been deprecated. You can run your emulator with full hardware virtualization support now by simply using -accel on.

/pathTo/emulator -avd avd_name -accel on

This switch is not necessary though, since the default setting for -accel is auto which means that if KVM is installed correctly, it will be used by default.

The value of 1024 is an example. Use the same amount of memory you configured your AVD to use. Further instructions on how to insert the parameters above to android-studio instead of launching the emulator manually, you can find on the android developers site. Personally, I prefer to launch it manually and have it there whenever I need it.

  • I was trying to start the emulator from terminal with -enable-kvm option and then i got unknown option: -enable-kvm – Oki Erie Rinaldi Jan 17 '17 at 8:57
  • Oh,, never mind about my comment above. I missed -qemu parameter. The android starts really fast! – Oki Erie Rinaldi Jan 17 '17 at 9:01
  • this line /pathTo/emulator -avd avd_name -qemu -m 1024 -enable-kvm saved my day! From 97% RAM to 70% of 8gb – abidibo May 24 '17 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.