简体   繁体   English

Xamarin Visual Studio 中的 Android 模拟器不显示应用程序

[英]Android emulator in Xamarin Visual Studio does not show the app

I made a new Xamarin Project in Visual Studio , I chose the Single View App .我在 Visual Studio 中创建了一个新的 Xamarin 项目,我选择了 Single View App。

  • Then I did not make any changes.然后我没有做任何改变。

  • I just pressed the Run Button.我刚刚按下了运行按钮。

  • The emulator started ,模拟器启动,

  • but the app was not appeared in the menu of the phone of the emulator.但该应用程序并未出现在模拟器手机的菜单中。

Is there anyone who know what cause the problem?有没有人知道导致问题的原因?

On Windows you have a couple of options to accelerate the Emulator.在 Windows 上,您有几个选项可以加速模拟器。 Read more here: https://docs.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?pivots=windows在此处阅读更多信息: https : //docs.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?pivots=windows

Using HyperV : Make sure to install the Windows Hypervisor Platform :使用 HyperV :确保安装Windows 管理程序平台

  1. Right click on the Windows button and select 'Apps and Features'.右键单击 Windows 按钮并选择“应用程序和功能”。
  2. Select Programs and Features on the right under related settings.在相关设置下选择右侧的程序和功能。
  3. Select Turn Windows Features on or off.选择打开或关闭 Windows 功能。
  4. Select Hyper-V and click OK.选择 Hyper-V,然后单击确定。

You probably need to restart your computer after.之后您可能需要重新启动计算机。

Intel HAXM : If you are not using HyperV and don't intend and don't run other hypervisors such as VMWare, VirtualBox etc. then you can install Intel HAXM.英特尔 HAXM :如果您不使用 HyperV 并且不打算也不运行其他虚拟机管理程序,例如 VMWare、VirtualBox 等,那么您可以安装英特尔 HAXM。

In the Android SDK manager, in tools, download Intel HAXM.在 Android SDK 管理器的工具中,下载 Intel HAXM。 After that is done, go to the folder where the Android SDK is installed.完成后,转到安装Android SDK的文件夹。 There should be an extras folder where there will be an installer for Intel HAXM.应该有一个 extras 文件夹,其中有英特尔 HAXM 的安装程序。

On macOS , Intel HAXM is the way to go.在 macOS 上,英特尔 HAXM 是要走的路。 Read how to install it here: https://docs.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?pivots=macos在此处阅读如何安装: https : //docs.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?pivots=macos

Should be as easy as running sh ~/Library/Developer/Xamarin/android-sdk-macosx/extras/intel/Hardware_Accelerated_Execution_Manager/silent_install.sh from a command-line.应该像从命令行运行sh ~/Library/Developer/Xamarin/android-sdk-macosx/extras/intel/Hardware_Accelerated_Execution_Manager/silent_install.sh

Either of these approaches should significantly speed up the Android Emulator.这两种方法中的任何一种都应该显着加快 Android Emulator。

If you have issues deloying to the emulator, sometimes the default configurations have very limited space and installing anything may fail due to the emulator running out of storage.如果您在部署到模拟器时遇到问题,有时默认配置的空间非常有限,并且由于模拟器的存储空间不足,安装任何东西都可能会失败。 Go to the Android AVD and increase the internal storage size.转到 Android AVD 并增加内部存储大小。

For other failures, check the Deploy Output window in Visual Studio and provide more information of what is going wrong.对于其他故障,请检查 Visual Studio 中的“部署输出”窗口,并提供有关出错原因的更多信息。 Otherwise it is just a guess.否则,这只是一个猜测。

This might be just a bug.这可能只是一个错误。 Create a new project.创建一个新项目。 If still blank wait 5 minutes.如果仍然空白,请等待 5 分钟。 Maybe your computer is slow so it takes time to load.也许您的计算机速度很慢,因此加载需要时间。

If you start using xamarin for the first time如果您是第一次开始使用 xamarin

  1. Create device from dropout menu (don't just let it create it from pressing run button).从 dropout 菜单创建设备(不要只是让它通过按下运行按钮来创建它)。
  2. Select device from dropout menu.从下拉菜单中选择设备。
  3. Run up.跑起来。

if it didn't added just restart Visual Studio (should change "Run" into name of the device)如果没有添加,只需重新启动 Visual Studio(应将“运行”更改为设备名称)

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

相关问题 适用于Android的Visual Studio Xamarin模拟器未显示 - Visual studio xamarin emulator for android not showing Xamarin 表单,在 Visual Studio Android 模拟器上运行的应用程序但在真实设备上崩溃 - Xamarin forms, App running on Visual Studio Android Emulator But crashes on real device Visual Studio 2017上的Xamarin android模拟器不可用 - Xamarin android emulator on Visual Studio 2017 blacked out Android 模拟器在 Xamarin 表单 Visual Studio 中显示错误 - Android Emulator showing a error in Xamarin forms Visual Studio Visual Studio无法调试Xamarin.Android应用 - Visual studio is not debuging Xamarin.Android app Android模拟器无法与Visual Studio一起使用 - Android emulator not working with visual studio Xamarin Android Visual Studio让部署覆盖应用程序 - Xamarin Android Visual Studio let deploy override app 使用Xamarin for Visual Studio调试正在运行的Android应用程序 - Debug a running android app using Xamarin for Visual Studio 如何直接或通过Visual Studio将图像添加到Android模拟器(Xamarin Project) - How to Add an Image to Android Emulator Directly or through Visual Studio (Xamarin Project) 如何使用Android模拟器设备在Visual Studio(Xamarin)中访问调试日志? - How can I reach debug log in Visual Studio (Xamarin), with Android emulator devices?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM