Android Studio KVM Setting?

余生长醉 提交于 2019-12-05 00:46:32

Android Studio 1.5 and 2.0 do not have such option any more.

Update: that is because the team has made KVM mandatory. And see comments from Google employees claiming that their new 2.0 emulator is also KVM-based.

Stuart Axon

You can do this:

Click on Run -> Edit Configurations and go to the Emulator tab

You can add it on "additional commandline options":

-qemu -enable-kvm

I'm not sure if there is also a GUI option somewhere though, or how to check if it is working or not.

I'd test the x86 image to see if it works any faster.

Alright, so when you see the message (on Android Studio v2 and higher):

KVM is required to run this AVD.

/dev/kvm device: permission denied

Grant current user access to dev/kvm

What you can do (manually, since I haven't found anything in Android Studio) to fix this is:

  1. Add your Linux user into the kvm group: sudo adduser your_linux_user kvm
    1. If the group doesn't exist, download this package sudo apt install qemu-kvm and try to add your user again into the kvm group.
  2. When the user has successfully been added into the KVM group, logout or restart and try opening Android Studio again.

This setting works totally fine in Ubuntu 18.04/18.10, but it should work in other distros as well.

  1. Downgrade to Android Studio 1.4 (delete Android Studio 1.5 installation, download zip from http://tools.android.com/download/studio/builds/1-4-0, follow installation instructions).
  2. Follow Stuart Axon's instructions above.

Gabor as far as I can tell is correct (and addresses the OP's question) - the option to use this acceleration by starting the emulator from within Android Studio 1.5 has been removed.

(Weirdly, I don't seem to be able access the acceleration when starting the emulator from the command line once Android Studio 1.5 has been installed - but maybe I'm wrong. Hopefully if I'm wrong someone who knows better will give an answer rather than just leaping at the chance to down vote. Glory to the downvote! Surely there should be badges for down voting: Gold 'downvoted 500 first questions', silver 'downvoted a question to -100', bronze 'downvoted a novice user into resigning'.)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!