macos - 如何在没有 android studio 的情况下在 Mac M1 上启动 Android Emulator

标签 macos android-studio command emulation apple-m1

我正在尝试使用此命令启动模拟器 emulator -avd Pixel_4_API_30 但它给了我一个错误:

[8633370112]:ERROR:android/android-emu/android/qt/qt_setup.cpp:28:Qt library not found at ../emulator/lib64/qt/lib
Could not launch '/Users/primulax/../emulator/qemu/darwin-x86_64/qemu-system-aarch64': No such file or directory

Android Studio 规范:

Build #AI-203.7717.56.2031.7935034, built on November 21, 2021
Runtime version: 11.0.10+0-b96-7249189 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.2
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin```

最佳答案

我刚刚在一台新设置的机器上遇到了同样的问题,通过 SDK 管理器安装了模拟器等等。

错误消息实际上说明了一切:如果您在计算机上转到 /Users/primulax/../emulator/qemu/,您会注意到当然没有 >darwin-x86_64 目录,但 darwin_aarch64,因为您在 M1 机器上。不管是什么原因,模拟器在错误的目录中查找,如果您只是复制 darwin_aarch64 文件夹并将您的副本命名为 darwin-x86_64,它会按预期工作。不理想,但在解决此路径问题之前,这是一种解决方法。

编辑:请查看@Andrew Stromme 的评论。当然,符号链接(symbolic link)是解决这个问题的更优雅的解决方案!

关于macos - 如何在没有 android studio 的情况下在 Mac M1 上启动 Android Emulator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71015608/

相关文章:

android - 添加 Android Jetpack Compose 导航库后,实现 ViewModelProvider.Factory 失败,继承自具有 '@JvmDefault' 的接口(interface)

Android Studio(0.2.0) 单元测试 logcat 无输出

android - "Google Play services are updating"发布时出错,不是模拟器(Google Play Services 12.6.73,华为设备)

linux - 如何找到经常做io的进程?

python - shell的&&和||在 python

macos - 我的 Mac 应用程序是否需要应用文件访问授权 key 才能支持拖放?

c++ - 打印 UTF-8 会产生不同的输出

windows - Golang 中的跨平台日志记录

macos - 避免 "Application Downloaded From The Internet"警告

linux - 如何使用 sed 删除双反斜杠