模拟器性能硬件加速
模拟器性能硬件加速
href="/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?pivots=windows">/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?pivots=windows
window虚拟机监控程序平台 = Windows Hypervisor平台
hyper-v是虚拟机软件,类似于vm,可安装其它系统,但似乎对mac
os支持不太好。只好放弃。
style='FONT-FAMILY: "Segoe UI", SegoeUI, "Segoe WP", "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: 600; COLOR: rgb(0,0,0); FONT-STYLE: normal; ORPHANS: 2; WIDOWS: 2; MARGIN: -10px 0px 0px; LETTER-SPACING: normal; LINE-HEIGHT: 1.3; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; overflow-wrap: break-word; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'
sourcestartlinenumber="13"
sourcefile="android/get-started/installation/android-emulator/hardware-acceleration.md">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">仿真器性能的硬件加速(Hyper-V和HAXM)
style='LIST-STYLE-TYPE: none; FONT-FAMILY: "Segoe UI", SegoeUI, "Segoe WP", "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: 400; PADDING-BOTTOM: 0px !important; FONT-STYLE: normal; PADDING-TOP: 0px !important; PADDING-LEFT: 0px !important; ORPHANS: 2; WIDOWS: 2; MARGIN: 0px; DISPLAY: flex; LETTER-SPACING: normal; PADDING-RIGHT: 0px !important; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; flex-wrap: wrap'
dir="ltr" data-bi-name="page info">
style="LIST-STYLE-TYPE: none; DISPLAY: flex; flex-basis: auto">
role=presentation data-article-date-source="ms.date"
datetime="-08-27T00:00:00.000Z">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">8月27日
style="LIST-STYLE-TYPE: none; DISPLAY: flex; flex-basis: auto">
style="LIST-STYLE-TYPE: none; PADDING-BOTTOM: 0px !important; PADDING-TOP: 0px !important; PADDING-LEFT: 0px !important; MARGIN: 0px; DISPLAY: inline-block; PADDING-RIGHT: 0px !important"
data-bi-name="contributors">
style='FONT-SIZE: 16px; FONT-FAMILY: "Segoe UI", SegoeUI, "Segoe WP", "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif; WHITE-SPACE: normal; WORD-SPACING: 0px; POSITION: relative; TEXT-TRANSFORM: none; FONT-WEIGHT: 400; COLOR: rgb(0,0,0); FONT-STYLE: normal; PADDING-TOP: 1px; PADDING-LEFT: 1px; ORPHANS: 2; WIDOWS: 2; DISPLAY: block; LETTER-SPACING: normal; PADDING-RIGHT: 1px; TEXT-INDENT: 0px; overflow-wrap: break-word; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; border-radius: 6px; transition: height 0.5s ease-in 0s, opacity 0.5s ease-in 0s'
dir=ltr>
style="MAX-WIDTH: 100%; BORDER-TOP: medium none; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 0px !important; PADDING-TOP: 0px !important; PADDING-LEFT: 0px !important; BORDER-LEFT: medium none; MARGIN: 0px; PADDING-RIGHT: 0px !important">
class=label
style="MAX-WIDTH: 100%; WHITE-SPACE: normal; FONT-WEIGHT: 600; COLOR: ; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 0px 0px 0.5em; DISPLAY: block; PADDING-RIGHT: 0px">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">选择您的开发环境
style="DISPLAY: flex; flex-wrap: wrap; -webkit-box-align: center; align-items: center; -webkit-box-pack: start; justify-content: flex-start">
class="button is-primary"
style="CURSOR: pointer; TEXT-DECORATION: none !important; BORDER-TOP: transparent 1px solid; HEIGHT: 2.25em; BORDER-RIGHT: transparent 1px solid; VERTICAL-ALIGN: top; WHITE-SPACE: nowrap; BORDER-BOTTOM: transparent 1px solid; POSITION: relative; COLOR: ; TEXT-ALIGN: center; BORDER-LEFT: transparent 1px solid; DISPLAY: inline-flex; LINE-HEIGHT: 1.5; MARGIN-RIGHT: -1px; border-radius: 2px 0px 0px 2px; -webkit-box-align: center; align-items: center; -webkit-box-pack: center; justify-content: center; user-select: none; -webkit-appearance: none; box-shadow: none">
class=visually-hidden
style="BOX-SIZING: border-box; OVERFLOW: hidden; BORDER-TOP: 0px; CLIP: rect(1px 1px 1px 1px); HEIGHT: 1px; FONT-FAMILY: inherit; BORDER-RIGHT: 0px; WIDTH: 1px; BORDER-BOTTOM: 0px; POSITION: absolute; COLOR: ; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; BORDER-LEFT: 0px; MARGIN: -1px; LINE-HEIGHT: normal; PADDING-RIGHT: 0px; overflow-wrap: normal; font-stretch: inherit; clip-path: inset(50%)"
CHECKED type=radio value=windows name=platform>
style="VERTICAL-ALIGN: inherit">Visual
Studio
style="CURSOR: pointer; TEXT-DECORATION: none !important; BORDER-TOP: 1px solid; HEIGHT: 2.25em; BORDER-RIGHT: 1px solid; VERTICAL-ALIGN: top; WHITE-SPACE: nowrap; BORDER-BOTTOM: 1px solid; POSITION: relative; COLOR: ; TEXT-ALIGN: center; BORDER-LEFT: 1px solid; DISPLAY: inline-flex; LINE-HEIGHT: 1.5; MARGIN-RIGHT: 0px; border-radius: 0px 2px 2px 0px; -webkit-box-align: center; align-items: center; -webkit-box-pack: center; justify-content: center; user-select: none; -webkit-appearance: none; box-shadow: none; border-image: initial">
class=visually-hidden
style="BOX-SIZING: border-box; OVERFLOW: hidden; BORDER-TOP: 0px; CLIP: rect(1px 1px 1px 1px); HEIGHT: 1px; FONT-FAMILY: inherit; BORDER-RIGHT: 0px; WIDTH: 1px; BORDER-BOTTOM: 0px; POSITION: absolute; COLOR: ; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; BORDER-LEFT: 0px; MARGIN: -1px; LINE-HEIGHT: normal; PADDING-RIGHT: 0px; overflow-wrap: normal; font-stretch: inherit; clip-path: inset(50%)"
type=radio value=macos name=platform>
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">适用于Mac的Visual
Studio
style='FONT-SIZE: 16px; MARGIN-BOTTOM: 0px; FONT-FAMILY: "Segoe UI", SegoeUI, "Segoe WP", "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: 400; COLOR: rgb(0,0,0); FONT-STYLE: normal; ORPHANS: 2; WIDOWS: 2; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">本文介绍如何使用计算机的硬件加速功能来最大化Android
Emulator的性能。
style='FONT-SIZE: 16px; MARGIN-BOTTOM: 0px; FONT-FAMILY: "Segoe UI", SegoeUI, "Segoe WP", "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: 400; COLOR: rgb(0,0,0); FONT-STYLE: normal; ORPHANS: 2; WIDOWS: 2; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>
style="VERTICAL-ALIGN: inherit">Visual
Studio使开发人员可以更轻松地在Android设备不可用或不切实际的情况下使用Android模拟器测试和调试他们的Xamarin.Android应用程序。
style="VERTICAL-ALIGN: inherit">但是,如果运行它的计算机上没有硬件加速,则Android模拟器运行速度太慢。
style="VERTICAL-ALIGN: inherit">通过将特殊的x86虚拟设备映像与计算机的虚拟化功能结合使用,可以极大地提高Android模拟器的性能。
style='FONT-SIZE: 16px; FONT-FAMILY: "Segoe UI", SegoeUI, "Segoe WP", "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: 400; COLOR: rgb(0,0,0); FONT-STYLE: normal; ORPHANS: 2; WIDOWS: 2; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'
data-pivot="windows">
style="MARGIN-BOTTOM: 12px; MARGIN-TOP: 32px; FONT-WEIGHT: 600; LINE-HEIGHT: 1.3">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">在Windows上加速Android模拟器
style="VERTICAL-ALIGN: inherit">以下虚拟化技术可用于加速Android模拟器:
style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 16px 0px 16px 38px; PADDING-RIGHT: 0px">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">微软的Hyper-V和Hypervisor平台
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">。
style="CURSOR: pointer; TEXT-DECORATION: underline; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/virtualization/hyper-v-on-windows/"
data-linktype="external">
style="VERTICAL-ALIGN: inherit">Hyper-V
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">是Windows的虚拟化功能,可以在物理主机上运行虚拟化计算机系统。
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">英特尔硬件加速执行管理器(HAXM)
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">。
style="CURSOR: pointer; TEXT-DECORATION: underline; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/articles/intel-hardware-accelerated-execution-manager-intel-haxm"
data-linktype="external">
style="VERTICAL-ALIGN: inherit">HAXM
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">是运行Intel
CPU的计算机的虚拟化引擎。
style="VERTICAL-ALIGN: inherit">为获得最佳性能,建议您使用Hyper-V加速Android模拟器。
style="VERTICAL-ALIGN: inherit">如果您的计算机上没有Hyper-V,则可以使用HAXM。
style="VERTICAL-ALIGN: inherit">如果满足以下条件,Android模拟器将自动使用硬件加速:
style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 16px 0px 16px 38px; PADDING-RIGHT: 0px">
style="VERTICAL-ALIGN: inherit">您可以在开发计算机上使用并启用硬件加速。
style="VERTICAL-ALIGN: inherit">模拟器正在运行为基于
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">x86
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">的虚拟设备
style="VERTICAL-ALIGN: inherit">创建的系统映像
style="VERTICAL-ALIGN: inherit">。
style="BACKGROUND: none transparent scroll repeat 0% 0%; POSITION: relative; COLOR: ; PADDING-TOP: 1px; PADDING-LEFT: 1px; DISPLAY: block; PADDING-RIGHT: 1px; overflow-wrap: break-word; border-radius: 6px; transition: height 0.5s ease-in 0s, opacity 0.5s ease-in 0s">
style="MARGIN-BOTTOM: 0px; MAX-WIDTH: 100%; MARGIN-TOP: 0px; FONT-WEIGHT: 600; COLOR: ">
class="docon docon-status-info-outline"
style="FONT-FAMILY: docons; FONT-VARIANT: normal; TEXT-TRANSFORM: none; FONT-WEIGHT: 400; DIRECTION: ltr; FONT-STYLE: normal; TEXT-ALIGN: center; DISPLAY: inline-block; LINE-HEIGHT: 16px; speak: none; -webkit-font-smoothing: antialiased">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">重要
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">您无法在另一个VM内运行VM加速仿真器,例如由VirtualBox,VMWare或Docker托管的VM。
style="VERTICAL-ALIGN: inherit">您必须
style="CURSOR: pointer; TEXT-DECORATION: underline; FONT-WEIGHT: 600; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/studio/run/emulator-acceleration.html#extensions"
data-linktype="external">
style="VERTICAL-ALIGN: inherit">直接在系统硬件上
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">运行Android模拟器
style="VERTICAL-ALIGN: inherit">。
style="VERTICAL-ALIGN: inherit">有关使用Android模拟器启动和调试的信息,请参阅Android模拟器
style="CURSOR: pointer; TEXT-DECORATION: underline; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/en-us/xamarin/android/deploy-test/debugging/debug-on-emulator"
data-linktype="relative-path">
style="VERTICAL-ALIGN: inherit">上的调试
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">。
style="CURSOR: pointer; TEXT-DECORATION: none; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
name=hyper-v-win>
style="MARGIN-BOTTOM: 12px; MARGIN-TOP: 32px; FONT-WEIGHT: 600; LINE-HEIGHT: 1.3">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">使用Hyper-V加速
style="VERTICAL-ALIGN: inherit">Hyper-V是加速Android模拟器的推荐选择。
style="VERTICAL-ALIGN: inherit">在启用Hyper-V之前,请阅读以下部分以验证您的计算机是否支持Hyper-V。
style="MARGIN-BOTTOM: 18px; MARGIN-TOP: 30px; FONT-WEIGHT: 600; LINE-HEIGHT: 1.3">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">验证对Hyper-V的支持
style="VERTICAL-ALIGN: inherit">Hyper-V在Windows Hypervisor平台上运行。
style="VERTICAL-ALIGN: inherit">要将Android模拟器与Hyper-V配合使用,您的计算机必须满足以下条件才能支持Windows
Hypervisor平台:
style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 16px 0px 16px 38px; PADDING-RIGHT: 0px">
style="VERTICAL-ALIGN: inherit">您的计算机硬件必须满足以下要求:
style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 0px 0px 0px 20px; PADDING-RIGHT: 0px">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">具有二级地址转换(SLAT)的64位Intel或AMD Ryzen
CPU。
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">VM监控模式扩展的CPU支持(Intel
CPU上的VT-c)。
style="VERTICAL-ALIGN: inherit">至少4
GB内存。
style="VERTICAL-ALIGN: inherit">在计算机的BIOS中,必须启用以下项:
style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 0px 0px 0px 20px; PADDING-RIGHT: 0px">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">虚拟化技术(根据主板制造商可能有不同的标签)。
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">硬件强制数据执行预防。
style="VERTICAL-ALIGN: inherit">您的计算机必须更新到Windows 10 April
更新(版本1803)或更高版本。
style="VERTICAL-ALIGN: inherit">您可以使用以下步骤验证Windows版本是否为最新版本:
style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 16px 0px 16px 38px; PADDING-RIGHT: 0px">
style="VERTICAL-ALIGN: inherit">在Windows搜索框中
style="VERTICAL-ALIGN: inherit">输入“
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">关于
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">”。
style="VERTICAL-ALIGN: inherit">在搜索结果中
style="VERTICAL-ALIGN: inherit">选择
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">关于您的PC
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">。
style="VERTICAL-ALIGN: inherit">在“
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">关于”
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">对话框中
style="VERTICAL-ALIGN: inherit">向下滚动
style="VERTICAL-ALIGN: inherit">到“
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">Windows规范”
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">部分。
style="VERTICAL-ALIGN: inherit">验证
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">版本
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">是否至少为1803:
style="CURSOR: pointer; TEXT-DECORATION: underline; POSITION: relative; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration-images/win/01-about-windows-w10.png#lightbox"
data-bi-name="lightbox" data-linktype="relative-path">
style="MAX-WIDTH: 100%; BORDER-TOP: 0px; HEIGHT: auto; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline-block"
alt=Windows规格
src="/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration-images/win/01-about-windows-w10-sml.png"
data-linktype="relative-path">
style="VERTICAL-ALIGN: inherit">要验证您的计算机硬件和软件是否与Hyper-V兼容,请打开命令提示符并键入以下命令:
style="BOX-SIZING: content-box; BORDER-TOP-COLOR: ; MARGIN-TOP: 16px; BORDER-BOTTOM: 0px; BORDER-LEFT-COLOR: ; COLOR: ; MIN-HEIGHT: 30px; DISPLAY: flex; BORDER-RIGHT-COLOR: ; -webkit-box-orient: horizontal; -webkit-box-direction: normal; flex-direction: row; border-image-source: ; border-image-slice: ; border-image-width: ; border-image-outset: ; border-image-repeat: "
data-bi-name="code-header">
style="PADDING-BOTTOM: 2px; PADDING-TOP: 2px; PADDING-LEFT: 16px; PADDING-RIGHT: 16px; -webkit-box-flex: 1; flex-grow: 1">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">CMD
style="BORDER-LEFT-WIDTH: 1px; OVERFLOW: visible; CURSOR: pointer; FONT-FAMILY: inherit; BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-COLOR: ; BORDER-BOTTOM-WIDTH: 0px; TEXT-TRANSFORM: none; BORDER-LEFT-COLOR: ; COLOR: ; PADDING-BOTTOM: 2px; BORDER-BOTTOM-COLOR: ; PADDING-TOP: 2px; PADDING-LEFT: 10px; MARGIN: 0px; DISPLAY: flex; BORDER-RIGHT-COLOR: ; LINE-HEIGHT: normal; PADDING-RIGHT: 10px; BORDER-TOP-WIDTH: 0px; BACKGROUND-COLOR: transparent; -webkit-box-align: center; align-items: center; -webkit-appearance: button; font-stretch: inherit; border-image-source: ; border-image-slice: ; border-image-width: ; border-image-outset: ; border-image-repeat: "
data-bi-name="copy">
style="FONT-FAMILY: docons; FONT-VARIANT: normal; TEXT-TRANSFORM: none; FONT-WEIGHT: 400; DIRECTION: ltr; FONT-STYLE: normal; TEXT-ALIGN: center; DISPLAY: inline-block; LINE-HEIGHT: 16px; MARGIN-RIGHT: 0.25em; speak: none; -webkit-font-smoothing: antialiased">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">复制
systeminfo
style="VERTICAL-ALIGN: inherit">如果列出的所有Hyper-V要求的值均为“
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">是”
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">,则表明您的计算机可以支持Hyper-V。
style="VERTICAL-ALIGN: inherit">例如:
style="CURSOR: pointer; TEXT-DECORATION: underline; POSITION: relative; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration-images/win/02-systeminfo-w158.png#lightbox"
data-bi-name="lightbox" data-linktype="relative-path">
style="MAX-WIDTH: 100%; BORDER-TOP: 0px; HEIGHT: auto; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline-block"
alt=示例systeminfo输出
src="/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration-images/win/02-systeminfo-w158-sml.png"
data-linktype="relative-path">
style="MARGIN-BOTTOM: 18px; MARGIN-TOP: 30px; FONT-WEIGHT: 600; LINE-HEIGHT: 1.3">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">启用Hyper-V加速
style="VERTICAL-ALIGN: inherit">如果您的计算机符合上述条件,请使用以下步骤使用Hyper-V加速Android模拟器:
style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 16px 0px 16px 38px; PADDING-RIGHT: 0px">
style="VERTICAL-ALIGN: inherit">进入
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">Windows功能
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">在Windows的搜索框,然后选择
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">启用Windows功能打开或关闭
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">在搜索结果中。
style="VERTICAL-ALIGN: inherit">在“
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">Windows功能”
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">对话框中,启用
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">Hyper-V
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">和
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">Windows
Hypervisor平台
style="VERTICAL-ALIGN: inherit">:
style="CURSOR: pointer; TEXT-DECORATION: underline; POSITION: relative; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration-images/win/03-hyper-v-settings-w158.png#lightbox"
data-bi-name="lightbox" data-linktype="relative-path">
style="MAX-WIDTH: 100%; BORDER-TOP: 0px; HEIGHT: auto; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline-block"
alt="启用Hyper-V和Windows Hypervisor平台"
src="/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration-images/win/03-hyper-v-settings-w158-sml.png"
data-linktype="relative-path">
style="VERTICAL-ALIGN: inherit">进行这些更改后,重新启动计算机。
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">安装
style="CURSOR: pointer; TEXT-DECORATION: underline; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/vs/" data-linktype="external">
style="VERTICAL-ALIGN: inherit">Visual
Studio 15.8或更高版本
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">(此版本的Visual
Studio为使用Hyper-V运行Android模拟器提供IDE支持)。
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">安装Android
Emulator程序包27.2.7或更高版本
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">。
style="VERTICAL-ALIGN: inherit">要安装此软件包,请导航到
style="VERTICAL-ALIGN: inherit">Visual Studio中的
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">工具> Android> Android SDK
Manager
style="VERTICAL-ALIGN: inherit">。
style="VERTICAL-ALIGN: inherit">选择“
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">工具”
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">选项卡,确保Android模拟器版本至少为27.2.7。
style="VERTICAL-ALIGN: inherit">还要确保Android SDK
Tools版本为26.1.1或更高版本:
style="CURSOR: pointer; TEXT-DECORATION: underline; POSITION: relative; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration-images/win/04-sdk-manager-w158.png#lightbox"
data-bi-name="lightbox" data-linktype="relative-path">
style="MAX-WIDTH: 100%; BORDER-TOP: 0px; HEIGHT: auto; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline-block"
alt="Android SDK和工具对话框"
src="/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration-images/win/04-sdk-manager-w158-sml.png"
data-linktype="relative-path">
style="VERTICAL-ALIGN: inherit">创建虚拟设备时(请参阅
style="CURSOR: pointer; TEXT-DECORATION: underline; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/en-us/xamarin/android/get-started/installation/android-emulator/device-manager"
data-linktype="relative-path">
style="VERTICAL-ALIGN: inherit">使用Android设备管理器管理虚拟设备
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">),请务必选择基于
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">x86
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">的系统映像。
style="VERTICAL-ALIGN: inherit">如果使用基于ARM的系统映像,则虚拟设备将不会加速并且运行缓慢。
style="MARGIN-BOTTOM: 12px; MARGIN-TOP: 32px; FONT-WEIGHT: 600; LINE-HEIGHT: 1.3">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">加速HAXM
style="VERTICAL-ALIGN: inherit">如果您的计算机不支持Hyper-V,请使用HAXM加速Android模拟器。
style="VERTICAL-ALIGN: inherit">如果要使用HAXM,则
style="VERTICAL-ALIGN: inherit">必须
style="CURSOR: pointer; TEXT-DECORATION: underline; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/en-us/xamarin/android/get-started/installation/android-emulator/troubleshooting?tabs=vswin#disable-devguard"
data-linktype="relative-path">
style="VERTICAL-ALIGN: inherit">禁用Device Guard
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">。
style="MARGIN-BOTTOM: 18px; MARGIN-TOP: 30px; FONT-WEIGHT: 600; LINE-HEIGHT: 1.3">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">验证HAXM支持
style="VERTICAL-ALIGN: inherit">要确定您的硬件是否支持HAXM,请按照
style="CURSOR: pointer; TEXT-DECORATION: underline; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/content/www/us/en/support/processors/000005486.html"
data-linktype="external">
style="VERTICAL-ALIGN: inherit">我的处理器是否支持英特尔虚拟化技术中
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">的步骤进行操作
style="CURSOR: pointer; TEXT-DECORATION: underline; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/content/www/us/en/support/processors/000005486.html"
data-linktype="external">?
style="VERTICAL-ALIGN: inherit">。
style="VERTICAL-ALIGN: inherit">如果您的硬件支持HAXM,则可以使用以下步骤检查是否已安装HAXM:
style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 16px 0px 16px 38px; PADDING-RIGHT: 0px">
style="VERTICAL-ALIGN: inherit">打开命令提示符窗口并输入以下命令:
style="BOX-SIZING: content-box; BORDER-TOP-COLOR: ; MARGIN-TOP: 16px; BORDER-BOTTOM: 0px; BORDER-LEFT-COLOR: ; COLOR: ; MIN-HEIGHT: 30px; DISPLAY: flex; BORDER-RIGHT-COLOR: ; -webkit-box-orient: horizontal; -webkit-box-direction: normal; flex-direction: row; border-image-source: ; border-image-slice: ; border-image-width: ; border-image-outset: ; border-image-repeat: "
data-bi-name="code-header">
style="PADDING-BOTTOM: 2px; PADDING-TOP: 2px; PADDING-LEFT: 16px; PADDING-RIGHT: 16px; -webkit-box-flex: 1; flex-grow: 1">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">CMD
style="BORDER-LEFT-WIDTH: 1px; OVERFLOW: visible; CURSOR: pointer; FONT-FAMILY: inherit; BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-COLOR: ; BORDER-BOTTOM-WIDTH: 0px; TEXT-TRANSFORM: none; BORDER-LEFT-COLOR: ; COLOR: ; PADDING-BOTTOM: 2px; BORDER-BOTTOM-COLOR: ; PADDING-TOP: 2px; PADDING-LEFT: 10px; MARGIN: 0px; DISPLAY: flex; BORDER-RIGHT-COLOR: ; LINE-HEIGHT: normal; PADDING-RIGHT: 10px; BORDER-TOP-WIDTH: 0px; BACKGROUND-COLOR: transparent; -webkit-box-align: center; align-items: center; -webkit-appearance: button; font-stretch: inherit; border-image-source: ; border-image-slice: ; border-image-width: ; border-image-outset: ; border-image-repeat: "
data-bi-name="copy">
style="FONT-FAMILY: docons; FONT-VARIANT: normal; TEXT-TRANSFORM: none; FONT-WEIGHT: 400; DIRECTION: ltr; FONT-STYLE: normal; TEXT-ALIGN: center; DISPLAY: inline-block; LINE-HEIGHT: 16px; MARGIN-RIGHT: 0.25em; speak: none; -webkit-font-smoothing: antialiased">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">复制
sc query intelhaxm
style="VERTICAL-ALIGN: inherit">检查输出以查看HAXM进程是否正在运行。
style="VERTICAL-ALIGN: inherit">如果是,你应该看到输出列表
style="BORDER-TOP: 1px solid; FONT-FAMILY: monospace, monospace; BORDER-RIGHT: 1px solid; BORDER-BOTTOM: 1px solid; PADDING-BOTTOM: 3px; DIRECTION: ltr; PADDING-TOP: 3px; PADDING-LEFT: 7px; BORDER-LEFT: 1px solid; DISPLAY: inline-block; LINE-HEIGHT: 19px; PADDING-RIGHT: 7px; border-radius: 2px; -webkit-font-smoothing: auto">intelhaxm
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">状态为
style="BORDER-TOP: 1px solid; FONT-FAMILY: monospace, monospace; BORDER-RIGHT: 1px solid; BORDER-BOTTOM: 1px solid; PADDING-BOTTOM: 3px; DIRECTION: ltr; PADDING-TOP: 3px; PADDING-LEFT: 7px; BORDER-LEFT: 1px solid; DISPLAY: inline-block; LINE-HEIGHT: 19px; PADDING-RIGHT: 7px; border-radius: 2px; -webkit-font-smoothing: auto">RUNNING
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">。
style="VERTICAL-ALIGN: inherit">例如:
style="MAX-WIDTH: 100%; BORDER-TOP: 0px; HEIGHT: auto; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline-block"
alt=HAXM可用时sc查询命令的输出
src="/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration-images/win/05-sc_query-w158.png"
data-linktype="relative-path">
style="VERTICAL-ALIGN: inherit">如果
style="BORDER-TOP: 1px solid; FONT-FAMILY: monospace, monospace; BORDER-RIGHT: 1px solid; BORDER-BOTTOM: 1px solid; PADDING-BOTTOM: 3px; DIRECTION: ltr; PADDING-TOP: 3px; PADDING-LEFT: 7px; BORDER-LEFT: 1px solid; DISPLAY: inline-block; LINE-HEIGHT: 19px; PADDING-RIGHT: 7px; border-radius: 2px; -webkit-font-smoothing: auto">STATE
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">未设置为
style="BORDER-TOP: 1px solid; FONT-FAMILY: monospace, monospace; BORDER-RIGHT: 1px solid; BORDER-BOTTOM: 1px solid; PADDING-BOTTOM: 3px; DIRECTION: ltr; PADDING-TOP: 3px; PADDING-LEFT: 7px; BORDER-LEFT: 1px solid; DISPLAY: inline-block; LINE-HEIGHT: 19px; PADDING-RIGHT: 7px; border-radius: 2px; -webkit-font-smoothing: auto">RUNNING
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">,则表示未安装HAXM。
style="VERTICAL-ALIGN: inherit">如果您的计算机可以支持HAXM但未安装HAXM,请使用下一节中的步骤安装HAXM。
style="CURSOR: pointer; TEXT-DECORATION: none; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
name=install-haxm-win>
style="MARGIN-BOTTOM: 18px; MARGIN-TOP: 30px; FONT-WEIGHT: 600; LINE-HEIGHT: 1.3">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">安装HAXM
style="VERTICAL-ALIGN: inherit">适用于Windows的HAXM安装包可从
style="CURSOR: pointer; TEXT-DECORATION: underline; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/android/articles/intel-hardware-accelerated-execution-manager"
data-linktype="external">
style="VERTICAL-ALIGN: inherit">英特尔硬件加速执行管理器
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">页面获得。
style="VERTICAL-ALIGN: inherit">使用以下步骤下载并安装HAXM:
style="PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 16px 0px 16px 38px; PADDING-RIGHT: 0px">
style="VERTICAL-ALIGN: inherit">在英特尔网站上,下载
style="VERTICAL-ALIGN: inherit">适用于Windows
style="VERTICAL-ALIGN: inherit">的最新
style="CURSOR: pointer; TEXT-DECORATION: underline; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/android/articles/intel-hardware-accelerated-execution-manager/"
data-linktype="external">
style="VERTICAL-ALIGN: inherit">HAXM虚拟引擎
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">安装程序。
style="VERTICAL-ALIGN: inherit">直接从英特尔网站下载HAXM安装程序的优点是可以放心使用最新版本。
style="VERTICAL-ALIGN: inherit">运行
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">intelhaxm-android.exe
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">以启动HAXM安装程序。
style="VERTICAL-ALIGN: inherit">接受安装程序对话框中的默认值:
style="MAX-WIDTH: 100%; BORDER-TOP: 0px; HEIGHT: auto; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline-block"
alt=英特尔硬件加速执行管理器设置窗口
src="/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration-images/win/06-haxm-installer.png"
data-linktype="relative-path">
style="VERTICAL-ALIGN: inherit">创建虚拟设备时(请参阅
style="CURSOR: pointer; TEXT-DECORATION: underline; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/en-us/xamarin/android/get-started/installation/android-emulator/device-manager"
data-linktype="relative-path">
style="VERTICAL-ALIGN: inherit">使用Android设备管理器管理虚拟设备
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">),请务必选择基于
style="FONT-WEIGHT: 600">
style="VERTICAL-ALIGN: inherit">x86
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">的系统映像。
style="VERTICAL-ALIGN: inherit">如果使用基于ARM的系统映像,则虚拟设备将不会加速并且运行缓慢。
style="MARGIN-BOTTOM: 12px; MARGIN-TOP: 32px; FONT-WEIGHT: 600; LINE-HEIGHT: 1.3">
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">故障排除
style="VERTICAL-ALIGN: inherit">有关解决硬件加速问题的帮助,请参阅Android模拟器
style="CURSOR: pointer; TEXT-DECORATION: underline; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/en-us/xamarin/android/get-started/installation/android-emulator/troubleshooting?tabs=vswin#accel-issues-win"
data-linktype="relative-path">
style="VERTICAL-ALIGN: inherit">故障排除
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">指南。
style='MARGIN-BOTTOM: 12px; FONT-FAMILY: "Segoe UI", SegoeUI, "Segoe WP", "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif; WHITE-SPACE: normal; WORD-SPACING: 0px; MARGIN-TOP: 32px; TEXT-TRANSFORM: none; FONT-WEIGHT: 600; COLOR: rgb(0,0,0); FONT-STYLE: normal; ORPHANS: 2; WIDOWS: 2; LETTER-SPACING: normal; LINE-HEIGHT: 1.3; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>
style="VERTICAL-ALIGN: inherit">
style="VERTICAL-ALIGN: inherit">相关链接
aria-hidden=true class="docon docon-link heading-anchor"
style="CURSOR: pointer; TEXT-DECORATION: none; VERTICAL-ALIGN: middle; TEXT-TRANSFORM: none; COLOR: ; DIRECTION: ltr; TEXT-ALIGN: center; FONT: 400 0.8em/16px docons; MARGIN: 0px 0px 4px 10px; DISPLAY: inline-block; VISIBILITY: hidden; BACKGROUND-COLOR: transparent; overflow-wrap: break-word; speak: none; -webkit-font-smoothing: antialiased; opacity: 0"
href="/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?pivots=windows#related-links">
style='FONT-SIZE: 16px; FONT-FAMILY: "Segoe UI", SegoeUI, "Segoe WP", "Helvetica Neue", Helvetica, Tahoma, Arial, sans-serif; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: 400; COLOR: rgb(0,0,0); PADDING-BOTTOM: 0px; FONT-STYLE: normal; PADDING-TOP: 0px; PADDING-LEFT: 0px; ORPHANS: 2; WIDOWS: 2; MARGIN: 16px 0px 16px 38px; LETTER-SPACING: normal; PADDING-RIGHT: 0px; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial'>
style="CURSOR: pointer; TEXT-DECORATION: none; COLOR: ; BACKGROUND-COLOR: transparent; overflow-wrap: break-word"
href="/studio/run/emulator"
data-linktype="external">
style="VERTICAL-ALIGN: inherit">在Android模拟器上运行应用程序
一键复制
编辑
Web IDE
原始数据
按行查看
历史