android - 在 Android Studio 2.3.3 中为 AVD 提供额外的命令行选项?

标签 android ubuntu android-emulator kvm

在这里尝试在 ubuntu 上设置 kvm。

官方文档只指向ubuntu docs安装kvm 提供的步骤herehere 在 Android Studio 中说

  1. 转到“运行”>“编辑配置”。
  2. 要将所有项目设置为全局默认值,请选择“Android “默认值”下的“应用程序”。
  3. 转到模拟器选项卡,选中“其他命令行选项”
  4. 添加-qemu -m 2047 -enable-kvm

标签在 2.3.3 中不存在并且已经是 know issue since 1.5

但问题一直是reported and closed作为预期的行为,没有关于在哪里运行的有效答案 -qemu -m 2047 -enable-kvm

更新 1 支持 KVM

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

最佳答案

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

在绑定(bind)此命令之前,您需要在 .bashrc(Ubuntu) 或路径(Windows) 中设置 ADB 的路径

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

关于android - 在 Android Studio 2.3.3 中为 AVD 提供额外的命令行选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45293497/

相关文章:

Android Facebook SDK 降低应用性能

java - 单击之前图像呈灰色 - 更改为颜色并记住单击的图像

android - 微调项的上下文菜单

linux - 如何帮助可执行文件找到共享库?

linux - Linux(Ubuntu 16.04)中的SVN(源码)安装目录

android - 移除没有放在backstack上的 fragment

android - 添加包后,Flutter 立即返回 Execution failed for task ':app:transformClassesWithDexBuilderForDebug'

bash - Dash shell 无法在没有双引号的情况下执行给定的命令

android-emulator - MOTODEV 比 Android 模拟器更快吗?

debugging - 来自 Ripple 和 Android 模拟器的调试器错误 “Unable to attach. The System cannot find the file specified”