AVD 管理器:AVD 的模拟器进程被终止。 Android Studio 4.1.3 和 MacOS High Sierra 10.13.6

时间:2021-01-03 09:20:25

标签: macos android-studio avd macos-high-sierra

我在对象中收到错误。我尝试进行所有检查(全部升级并正确安装),但仍然出现错误:

<块引用>

AVD 管理器:

AVD 的模拟器进程被终止。

AVD Manager: The emulator process for AVD was killed.

以下是模拟器的详细信息:

Name: Pixel_3a_API_30
CPU/ABI: Google Play Intel Atom (x86)
Path: /Users/simone/.android/avd/Pixel_3a_API_30.avd
Target: google_apis_playstore [Google Play] (API level 30)
Skin: pixel_3a
SD Card: 512M
fastboot.chosenSnapshotFile: 
runtime.network.speed: full
hw.accelerometer: yes
hw.device.name: pixel_3a
hw.lcd.width: 1080
hw.initialOrientation: Portrait
image.androidVersion.api: 30
tag.id: google_apis_playstore
hw.mainKeys: no
hw.camera.front: emulated
avd.ini.displayname: Pixel 3a API 30
hw.gpu.mode: software
hw.ramSize: 1536
PlayStore.enabled: true
fastboot.forceColdBoot: no
hw.cpu.ncore: 4
hw.keyboard: yes
hw.sensors.proximity: yes
hw.dPad: no
hw.lcd.height: 2220
vm.heapSize: 256
skin.dynamic: yes
hw.device.manufacturer: Google
hw.gps: yes
hw.audioInput: yes
image.sysdir.1: system-images/android-30/google_apis_playstore/x86/
showDeviceFrame: yes
hw.camera.back: virtualscene
AvdId: Pixel_3a_API_30
hw.lcd.density: 440
hw.arc: false
hw.device.hash2: MD5:0e6953ebf01bdc6b33a2f54746629c50
fastboot.forceChosenSnapshotBoot: no
fastboot.forceFastBoot: yes
hw.trackBall: no
hw.battery: yes
hw.sdCard: yes
tag.display: Google Play
runtime.network.latency: none
disk.dataPartition.size: 2G
hw.sensors.orientation: yes
avd.ini.encoding: UTF-8
hw.gpu.enabled: yes

9 个答案:

答案 0 :(得分:9)

修正:按照此处的指南Codesign QEMU。使用 /Users/<username>/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64 作为 qemu 的目录(可能不同)。

我遇到的问题是 qemu-system-x86_64。在终端中运行模拟器会显示以下错误:cannot add library /Users/<username>/Library/Android/sdk/emulator/qemu/darwin-x86_64/lib64/vulkan/libvulkan.dylib: failed

为了解决这个问题,我找到了这些帖子: Reddit Codesign QEMU

答案 1 :(得分:5)

更新 - 28/4/2021

  1. 创建具有以下内容的 entitlements.xml 文件:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>com.apple.security.hypervisor</key>
        <true/>
    </dict>
    </plist>

  1. 并根据需要在您的 SDK 所在的 qemu 路径上运行。
codesign -s - --entitlements entitlements.xml --force ~/Library/Android/sdk/emulator/qemu/darwin-x86_64/qemu-system-x86_64

答案基于https://www.arthurkoziel.com/qemu-on-macos-big-sur/

相关问题:

https://issuetracker.google.com/issues/181142249 https://issuetracker.google.com/issues/186436367

更新到 Android Emulator 3.5.6 现在应该可以修复它

Original solution >>> Thanks to laalto

答案 2 :(得分:3)

将“hw.gpu.mode: auto”改为“hw.gpu.mode = software”。

答案 3 :(得分:2)

在 M1 Mac 上进行模拟时,您需要从“其他图像”选项卡中选择系统图像。确保您拍摄了 arm64 图像。

还有一个来自 google 的关于 M1 仿真的 preview-repo

enter image description here

答案 4 :(得分:1)

我以前遇到过这个问题,只需按照以下步骤操作即可;

  1. 转到 SDK 管理器 -> SDK 工具
  2. 更新以下选项 2:
    • 安卓模拟器
    • 英特尔 x86 仿真器加速器(HAXM 安装程序)

enter image description here

答案 5 :(得分:0)

Android Emulator 的先前版本似乎不适用于 HAXM 7.6.5。如果您安装新版本的 Android Emulator(30.5.6),它将正常工作。如果它仍然不起作用,您应该尝试冷启动。它对我有用。

答案 6 :(得分:0)

它发生在我的 Windows 10 上,问题出在一个名为 winspool.drv 的文件系统中尝试修复此文件这对我来说解决了问题在 Windows 中打开 cmd 并以管理员身份运行它并键入此命令 sfc /scannow它将进行扫描并在扫描完成后修复损坏的文件重新启动计算机并再次尝试运行模拟器

答案 7 :(得分:0)

您可以使用 Android Emulator Apple Silicon Preview. 我尝试了所有其他选项,但对我没有任何效果。

然而,这目前有一些限制。将来可能会工作得更好。

目前已知的问题也在这里进行了解释。 https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html

这是一篇关于此旅程和完整设置以及不同解决方案面临的问题的好文章: https://medium.com/mobile-app-development-publication/my-journey-to-setup-android-emulator-for-m1-macbook-pro-b8365321b3e7

答案 8 :(得分:-2)

这有一个非常简单的解决方案,仅当安装过程完成并且模拟器仍未启动时, 解决方案:尝试使用较旧的 API 版本或任何较旧的稳定 android API 版本。 就我而言,我使用的最新版本是 API-31,但 API-28 对我有用。 将您的 android API 更改为任何旧版本 尝试一下。 这对我有用。