Pri*_*laX 9 macos command emulation android-studio 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\nCould not launch '/Users/primulax/../emulator/qemu/darwin-x86_64/qemu-system-aarch64': No such file or directory\nRun Code Online (Sandbox Code Playgroud)\nAndroid Studio 规格:
\nBuild #AI-203.7717.56.2031.7935034, built on November 21, 2021\nRuntime version: 11.0.10+0-b96-7249189 aarch64\nVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.\nmacOS 12.2\nGC: G1 Young Generation, G1 Old Generation\nMemory: 2048M\nCores: 8\nRegistry: external.system.auto.import.disabled=true\nNon-Bundled Plugins: org.jetbrains.kotlin\nRun Code Online (Sandbox Code Playgroud)\n\xe2\x9c\x85 我能够使用~/Library/Android/sdk/emulator/emulator -avd Pixel_4_API_30此命令运行
AgE*_*AgE 26
在 Ubuntu 上使用而不是在 MacOS上~/Library/Android/sdk/emulator/emulator使用。~/Library/Android/sdk/tools/emulator~/Android/Sdk/emulator/emulator
mic*_*ohl 10
我刚刚在新设置的机器上遇到了同样的问题,通过 SDK 管理器安装了模拟器等等。
错误消息实际上说明了一切:如果您在您的计算机上访问/Users/primulax/../emulator/qemu/,您会注意到当然没有darwin-x86_64目录,但是darwin_aarch64,因为您在 M1 计算机上。无论模拟器在错误的目录中查找的原因是什么,如果您只是复制该darwin_aarch64文件夹并命名您的副本darwin-x86_64,它就会按预期工作。并不理想,但在解决此路径问题之前,这是一种解决方法。
编辑:请看看@Andrew Stromme 的评论。当然,符号链接是解决这个问题的更优雅的方法!