2

Trying to setup kvm on ubuntu here.

The official docs only points to ubuntu docs to install kvm The steps provided here and here Says to In Android Studio

  1. Go to Run > Edit Configurations.
  2. To set as global default for all projects, select "Android Application" under "Defaults".
  3. Go to the emulator tab, check "Additional command line options"
  4. Add -qemu -m 2047 -enable-kvm

The tab is not present in 2.3.3 and has been a know issue since 1.5

But the issue has been reported and closed as intended behavior with no valid answer to on where to run -qemu -m 2047 -enable-kvm

Update 1 KVM is supported

nishon@nishon-Inspiron-5420 ~ $ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

nishon@nishon-Inspiron-5420 ~ $ egrep -c '(vmx|svm)' /proc/cpuinfo
4
nishon.tan
  • 969
  • 2
  • 8
  • 21

2 Answers2

0

Passing the additional while launching avd from bash shell seems to be working. I am entirely not sure though.

 nishon@nishon-Inspiron-5420 ~ $ emulator -avd [Enter AVD name] -qemu -m 2047 -enable-kvm

Before tying this command you need to setup path to ADB in your .bashrc(Ubuntu) or path(Windows)

Reference https://developer.android.com/studio/run/emulator-commandline.html

nishon.tan
  • 969
  • 2
  • 8
  • 21
0

I too need that additional command line option for emulator

but anyhow i found a alternative way for it... go to the sdk/tools

cd ~/Android/Sdk/tools

run this command to start avd using system libraries..

./emulator -avd YOUR_AVD_NAME -use-system-libs

the apps worked fine for me when the emulator is running in the background.