android emulator 命令的一些问题

在 ubuntu 20 系统中

  • android emulator 命令的位置在 $ANDROID_SDK_HOME/emulator 目录下

  • android studio 创建的 avd 存放在 ~/.android/avd 目录下

  • 如果已经在Android Studio 中创建了avd,但是执行 ./emulator -list-avds 如果找不到任何 avd,可以将配置一下,在 ~/.bashrc 中添加一行

export ANDROID_AVD_HOME="/home/sunzy/.android/avd/"

  • 目前好像真的不能运行 arm 架构的 avd,这个目前还没有找到好的办法

sunzy@sunzy:~/soft/usoft/Android_sdk_linux/Sdk/emulator$ ./emulator -avd Pixel_2_API_31
INFO    | Android emulator version 31.2.8.0 (build_id 8143646) (CL:N/A)
PANIC: Avd's CPU Architecture 'arm64' is not supported by the QEMU2 emulator on x86_64 host.

大家有好的解决办法可以cue我

  • failed to initialize KVM: Device or resource busy 解决办法

你是否同时在用VirtualBox,关闭 VirtualBox

https://www.agix.com.au/kvm-error-ioctlkvm_create_vm-failed-16-device-or-resource-busy/#:~:text=Error%20starting%20domain%3A%20internal%20error%3A%20process%20exited%20while,another%20hypervisor%2C%20in%20our%20case%20it%20was%20VirtualBox.

sunzy@sunzy:~/soft/usoft/Android_sdk_linux/Sdk/emulator$ ./emulator -read-only -avd 13.5_Freeform_API_30
INFO    | Android emulator version 31.2.8.0 (build_id 8143646) (CL:N/A)
WARNING | unexpected system image feature string, emulator might not function correctly, please try updating the emulator.
WARNING | cannot add library /home/sunzy/soft/usoft/Android_sdk_linux/Sdk/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
INFO    | added library /home/sunzy/soft/usoft/Android_sdk_linux/Sdk/emulator/lib64/vulkan/libvulkan.so
INFO    | configAndStartRenderer: setting vsync to 60 hz
ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy
qemu-system-x86_64: failed to initialize KVM: Device or resource busy

你可能感兴趣的:(anroid,android,android,studio)