简体   繁体   English

如何强制Visual Studio使用特定的Android模拟器?

[英]How to force Visual Studio to use specific Android Emulator?

I have a question about Android Emulator(s) (well, there are actually three sub questions). 我有一个关于Android模拟器的问题(嗯,实际上有三个子问题)。 So, In VS2015 we have two Emulators installed: 因此,在VS2015中,我们安装了两个模拟器:

在此处输入图片说明

On the left - built in Visual Studio Android Emulator (made by Microsoft), using Hyper-V (please correct me if I'm wrong) 左侧-使用Hyper-V内置于Visual Studio Android模拟器(由Microsoft制造)中(如果我输入错了,请纠正我)

On the right - built in.. Xamarin.Studio? 在右侧-内置。Xamarin.Studio? Android Emulator (made by Android), using HAXM (please correct me if I'm wrong). 使用HAXM的Android模拟器(由Android制造)(如果我输入错了,请纠正我)。

I have a problem, because when you create a Xamarin.Forms project you get this Virtual Device setup by default: 我有一个问题,因为在创建Xamarin.Forms项目时,默认情况下会获得此虚拟设备设置: 在此处输入图片说明 It uses API19, but when I click "Run", it's complies without errors and deploy/run in new Android Emulator (on the right). 它使用API​​19,但是当我单击“运行”时,它符合要求且没有错误,并在新的Android仿真器中(在右侧)部署/运行。 Why? 为什么? When I open Android Virtual Device Manager, selects the same virtual device and click "Starts", it opens the Android Emulator (on the left). 当我打开Android虚拟设备管理器时,选择相同的虚拟设备并单击“启动”,它将打开Android模拟器(在左侧)。 Why? 为什么?

I've enabled Hyper-V for now, my Windows emulators work. 我现在已经启用了Hyper-V,我的Windows模拟器可以正常工作。

How can I force Visual Studio to run on old "on the left" Android Emulator when I run the project? 运行项目时,如何强制Visual Studio在旧的“左侧” Android模拟器上运行? Can I set this up? 我可以设置吗?

When you open your Android Emulator Manager you will find the following choice 当您打开Android Emulator Manager时,您会发现以下选择

在此处输入图片说明

x86 means AVD with HAXM. x86表示具有HAXM的AVD。 If you do not have that choice please install image with HAXM 如果您没有选择,请使用HAXM安装映像

在此处输入图片说明

The emulator that create by android emulator manager is Google's default emulators , and Your left side emulator that means the Google's default emulators and with the skin like "WQVAG" or someting others. 由android模拟器管理器创建的模拟器是Google的默认模拟器 ,而您的左侧模拟器则表示Google的默认模拟器,并带有“ WQVAG”之类的外观。

Your right side emulator that is created by vistual studio: 由vistual studio创建的右侧仿真器

在此处输入图片说明

when you find the the CPU Architecture is x86 that means it works with HAXM 当您发现CPU体系结构是x86时 ,这意味着它可以与HAXM一起使用

在此处输入图片说明

Use the different AVD Name will clearify which emulator you selected to run. 使用不同的AVD名称将清除您选择要运行的仿真器。

How can I force Visual Studio to run on old "on the left" Android Emulator when I run the project? 运行项目时,如何强制Visual Studio在旧的“左侧” Android模拟器上运行? Can I set this up? 我可以设置吗?

Select the emulator that create by android emulator manager with the skin. 选择具有皮肤的android模拟器管理器创建的模拟器 在此处输入图片说明

On the left is an AVD thus it is Google's default emulators. 左侧AVD因此它是Google的默认模拟器。 It could be HAXM accelerated if you installed HAXM. 如果安装了HAXM,则可能是HAXM加速的。

On the right is the VS Emulator for Android created by the Visual Studio team. 右边是Visual Studio团队创建的VS Emulator for Android。

You are confusing the built in AVD emulators with the VS Android emulator. 您会将内置的AVD模拟器与VS Android模拟器混淆。

By default whichever Device is selected (Has the green play button next to it) will be used. 默认情况下,将使用所选的任何Device (旁边有绿色的播放按钮) In your case, you have the VS Emulator for Android selected and thus it will always deploy to that one. 在您的情况下,您已选择了适用于AndroidVS Emulator ,因此它将始终部署到该VS Emulator

You can use the small down arrow to select another compatible emulator such as the Google emulators if you created a new AVD that is compatible with your project. 如果您创建了与项目兼容的新AVD,则可以使用向下的小箭头选择其他兼容的模拟器,例如Google模拟器。

See further: https://developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/debug-on-emulator/android-sdk-emulator/ 进一步了解: https : //developer.xamarin.com/guides/android/deployment,_testing,_and_metrics/debug-on-emulator/android-sdk-emulator/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM