[英]Android Emulator not working with Xamarin / Visual Studio Mac
Hi i'm really struggling to get the Android emulator running on my Mac.嗨,我真的很难让 Android 模拟器在我的 Mac 上运行。 What are the steps I need to take to get this working?
我需要采取哪些步骤才能使其正常工作?
I've got Visual Studio 2019 on MacOS Catalina我在 MacOS Catalina 上安装了 Visual Studio 2019
This is on a new blank Xamarin Forms project这是一个新的空白 Xamarin Forms 项目
I've tried to go Tools > Device Manager > New Device.我试过 go 工具 > 设备管理器 > 新设备。 Pixel 3 XL, x86_64, Q 10.
像素 3 XL,x86_64,Q 10。
I keep getting this message:我不断收到此消息:
Android emulator component is incomplete therefore the device Pixel 3 XL Q 10.0 - API 29 could not be created.
Android 仿真器组件不完整,因此无法创建设备 Pixel 3 XL Q 10.0 - API 29。 Do you want us to reinstall the Android Emulator?
您希望我们重新安装 Android 仿真器吗?
I've clicked the button to reinstall the android emulator but it doesnt work.我点击了重新安装 android 仿真器的按钮,但它不起作用。
Also tried with OS 8.1 and setting processor as x86 - all the combinations give a similar error messages还尝试使用 OS 8.1 并将处理器设置为 x86 - 所有组合都会给出类似的错误消息
When i go to Tools > SDK Manager, the following are ticked:当我 go 到 Tools > SDK Manager 时,勾选以下:
Android 10.0 - Q Android 10.0 - Q
Similar for 9.0, 8.1, 7.1, 7.0, 6.0 9.0、8.1、7.1、7.0、6.0 类似
Version details - Version is 8.6.2 (build 6)版本详细信息- 版本为 8.6.2(内部版本 6)
Android SDK Manager Android SDK 经理
Android Device Manager Android 设备管理器
Xamarin.Android Xamarin.Android
Android SDK: /Users/user/Library/Developer/Xamarin/android-sdk-macosx Android SDK:/Users/user/Library/Developer/Xamarin/android-sdk-macosx
I ended up downloading Android Studio, then running the installers from there and then finally went back to VS Mac and installed an emulator device - that seemed to work.我最终下载了 Android Studio,然后从那里运行安装程序,最后回到 VS Mac 并安装了一个仿真器设备——这似乎工作。
I am able to solve the issue by creating an XML file named entitlements.xml with the following content:我可以通过创建一个名为 entitlements.xml 的 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>
Then run the following command然后运行以下命令
codesign -s - --entitlements entitlements.xml --force /Users/macbookpro/Library/Developer/Xamarin/android-sdk-macosx/emulator/qemu/darwin-x86_64/qemu-system-x86_64
to identify your Android SDK installed folder use Visual Studio> Tools > SDK Manager then check the Android SDK path to identify your Android SDK installed folder use Visual Studio> Tools > SDK Manager then check the Android SDK path
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.