4

Ubuntu AVD 无法启动问题追踪

 2 years ago
source link: http://i.lckiss.com/?p=7665
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

公司 Windows 有监控和 杀毒扫描,很卡,不得已又用回 Linux,即便如此也只能用虚拟机的方式

环境:Elementary 0S 5.1 ( Ubuntu 18.04 LTS (bionic) )

KVM requires a CPU that supports vmx or svm

找到 Android SDK 目录下的 emulator 目录,然后切到终端查一下有哪些 avd:

./emulator -list-avds

然后直接用名字启动即可:

./emulator -avd AVD_NAME

启动不了会报错,比如:

INFO    | Android emulator version 31.1.4.0 (build_id 7920983) (CL:N/A)
WARNING | unexpected system image feature string, emulator might not function correctly, please try updating the emulator.
ERROR   | x86_64 emulation currently requires hardware acceleration!
CPU acceleration status: KVM requires a CPU that supports vmx or svm
More info on configuring VM acceleration on Linux:
https://developer.android.com/studio/run/emulator-acceleration#vm-linux
General information on acceleration: https://developer.android.com/studio/run/emulator-acceleration.

关闭虚拟机,去虚拟机的 CPU 设置中开启各种虚拟化即可。

/dev/kvm device permission denied

先装软件包:

sudo apt install qemu-kvm

追加权限:

sudo adduser username kvm

安装完重启。

或者直接粗暴一点:

sudo chown username:username /dev/kvm

参考:https://stackoverflow.com/questions/37300811/android-studio-dev-kvm-device-permission-denied


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK