简体   繁体   English

在 AMD 处理器上运行 Android Studio 模拟器

[英]Run Android studio emulator on AMD processor

Android newbie.安卓新手。 My processor is AMD, not Intel, so I can't open the emulator in Android studio.我的处理器是 AMD,而不是 Intel,所以我无法在 Android Studio 中打开模拟器。

This answer has the comment: 'You can run the ARM (non Intel) emulator image.这个答案有这样的评论:'你可以运行 ARM(非英特尔)模拟器镜像。 From your list, just choose a non Intel emulation.'从您的列表中,选择一个非英特尔仿真。 They don't explain where this can be found.他们没有解释在哪里可以找到它。 Any ideas?有任何想法吗? Thanks谢谢

Android Studio emulator and AMD CPU Android Studio 模拟器和 AMD CPU

Alright, first of all, open your Android SDK Manager: Tools -> Android -> SDK Manager, then chose any platform/package you want to download, expand it and select ARM EABI v7a System Image or ARM 64 v8a System Image then install.好的,首先,打开你的Android SDK Manager:Tools -> Android -> SDK Manager,然后选择你想下载的任何平台/包,展开它并选择ARM EABI v7a System ImageARM 64 v8a System Image然后安装。

After that, open Android AVD Manager: Tools -> Android -> AVD Manager and create an emulator.之后,打开Android AVD Manager:Tools -> Android -> AVD Manager 并创建一个模拟器。 You may chose from existing or create your own.您可以选择现有的或创建自己的。

For better results, you may need to restart Android Studio.为了获得更好的结果,您可能需要重新启动 Android Studio。

[UPDATE] [更新]

Thanks to @bjornredemption for his clue.感谢@bjornredemption提供线索。

As per Google's latest documentation for Android Emulator v29+ Navigate to Tools -> Android -> SDK Manager then select the "SDK Tools" tab and tick this option:根据Google 针对 Android Emulator v29+ 的最新文档导航到 Tools -> Android -> SDK Manager 然后选择“SDK Tools”选项卡并勾选此选项:

Android Emulator Hypervisor Driver for AMD Processors用于 AMD 处理器的 Android Emulator Hypervisor 驱动程序

Then click Apply to download then use it for your emulator.然后单击应用下载,然后将其用于您的模拟器。

Open Android AVD Manager: Tools -> Android -> AVD Manager and create an emulator:打开 Android AVD 管理器:工具 -> Android -> AVD 管理器并创建一个模拟器:

  • Create Virtual Device创建虚拟设备
  • Choose any hardware选择任何硬件
  • Now in system image you need to click on the "Other Images" tab现在在系统映像中,您需要单击“其他映像”选项卡
  • Select an image to install.选择要安装的映像。 IMPORTANT : Notice that for AMD in the "ABI" column it has to say: ARM EABI v7a or ARM 64 v8a重要提示:请注意,对于“ABI”列中的 AMD,它必须说: ARM EABI v7aARM 64 v8a
  • Install it and restart Android Studio安装并重启 Android Studio

This works for me.这对我有用。

I am using microsoft's Android emulator with Android Studio.我在 Android Studio 中使用微软的 Android 模拟器 I have an AMD FX8350.我有一个 AMD FX8350。 The ARM one in android studio is terribly slow. android studio 中的 ARM 非常慢。

The only issue is that it requires Hyper-V which is not available on windows 10 Home.唯一的问题是它需要 Windows 10 Home 不可用的Hyper-V。

Its a really quick emulator and it is free.它是一个非常快速的模拟器,而且是免费的。 The best emulator I have used.我用过的最好的模拟器。

I have a Ryzen 2600X and I am able to run the emulator without problems.我有一个 Ryzen 2600X,我可以毫无问题地运行模拟器。 Here are the tweaks I made:以下是我所做的调整:

*NOTE: You don't need the beta version of Android Studio or Android Emulator. *注意:您不需要 Android Studio 或 Android Emulator 的测试版。

  1. Go to the MB bios and turn SVM on (CPU Virtualization).转到 MB bios 并打开 SVM(CPU 虚拟化)。
  2. In Windows right click Windows Button => Select "Apps and Features" => "Programs and features" => "Turn Windows Features on and off"在 Windows 中右键单击 Windows 按钮 => 选择“应用程序和功能”=>“程序和功能”=>“打开和关闭 Windows 功能”
  3. In the displayed list select Hyper-V checkbox == Make sure the subfolders are all selected.在显示的列表中选择 Hyper-V 复选框 == 确保所有子文件夹都被选中。 When prompted to restart, restart the PC.当提示重新启动时,重新启动 PC。
  4. After restart and update instalation screen you are back in Windows and you should be able to run the Emulator.重新启动并更新安装屏幕后,您将返回 Windows,您应该能够运行模拟器。

**Note: I have selected x86_64 and plain x86 images(both API 28) from the x86 Images tab and they work just fine. **注意:我从 x86 图像选项卡中选择了 x86_64 和普通 x86 图像(均为 API 28),它们工作得很好。

***Note: Might also check for Android Licenses if errors pop up, I had an issue because of this while using Flutter, maybe it's related to that. ***注意:如果出现错误,也可能会检查 Android 许可证,因此我在使用 Flutter 时遇到了问题,可能与此有关。

Since Android Studio 3.2 and Android Emulator 27.3.8 - the android emulator is supported by Windows Hypervisor Platform and as stated in the official android developer blog - there is mac support (since OS X v10.10 Yosemite) and windows support (since April 2018 Update).由于 Android Studio 3.2 和 Android Emulator 27.3.8 - Windows Hypervisor Platform支持 android 模拟器,正如官方android 开发者博客中所述- 有 mac 支持(自 OS X v10.10 Yosemite 起)和 Windows 支持(自 2018 年 4 月起)更新)。 You may find further instructions on the developer blog.您可以在开发者博客上找到更多说明。

In my opinion, the performance is significantly better than all previous workarounds.在我看来,性能明显优于以前的所有解决方法。

Recent updates enabled computers with AMD processors to run Android Emulator and you don't need to install ARM images anymore.最近的更新使配备 AMD 处理器的计算机能够运行 Android Emulator,您不再需要安装 ARM 映像。 Taken from the Android Developers blog:摘自 Android 开发者博客:

If you have an AMD processor in your computer you need the following setup requirements to be in place:如果您的计算机中有 AMD 处理器,则需要满足以下设置要求:

  • AMD Processor - Recommended: AMD® Ryzen™ processors AMD 处理器 - 推荐:AMD® Ryzen™ 处理器
  • Android Studio 3.2 Beta or higher Android Studio 3.2 Beta 或更高版本
  • Android Emulator v27.3.8+安卓模拟器 v27.3.8+
  • x86 Android Virtual Device (AVD) x86 Android 虚拟设备 (AVD)
  • Windows 10 with April 2018 Update带有 2018 年 4 月更新的 Windows 10
  • Enable via Windows Features: "Windows Hypervisor Platform"通过 Windows 功能启用:“Windows 管理程序平台”

The important point is enabling Windows Hypervisor Platform and that's it!重要的一点是启用 Windows 管理程序平台,就是这样! I strongly recommend reading the whole blog post:我强烈建议阅读整篇博文:
https://android-developers.googleblog.com/2018/07/android-emulator-amd-processor-hyper-v.html https://android-developers.googleblog.com/2018/07/android-emulator-amd-processor-hyper-v.html

My laptop runs on AMD Ryzen 5 and I was facing a similar issue.我的笔记本电脑在 AMD Ryzen 5 上运行,我遇到了类似的问题。 I tried some of the fixes here but didn't work but eventually, I read hundreds of blogs and came up with a solution.我在这里尝试了一些修复,但没有奏效,但最终,我阅读了数百篇博客并提出了解决方案。 You need the following setup requirements to be in place:您需要满足以下设置要求:

AMD Processor - Recommended: AMD® Ryzen™ processors Android Studio 3.2 Beta or higher(I run on BETA, However the latest version of Android Studio doesn't need you to install ARM images anymore) Android Emulator v27.3.8+ x86 Android Virtual Device (AVD) Windows 10 with April 2018 Update Enable via Windows Features: "Windows Hypervisor Platform" AMD 处理器 - 推荐:AMD® Ryzen™ 处理器 Android Studio 3.2 Beta 或更高版本(我在 BETA 上运行,但最新版本的 Android Studio 不再需要您安装 ARM 映像) Android Emulator v27.3.8+ x86 Android Virtual Device (AVD) 带有 2018 年 4 月更新的 Windows 10 通过 Windows 功能启用:“Windows 管理程序平台”

With all these features in place, I was running Android studio again.有了所有这些功能,我再次运行 Android Studio。 Hope it helped!希望有帮助!

On mine, I had to install ARM AEBI a7a System Image and Google APIs, and also installed MIPS which was only available for API 15, 16, and 17 (I didn't go below 15.) Took about 12 hours of tinkering, but it works now.在我的机器上,我必须安装 ARM AEBI a7a System Image 和 Google API,还安装了仅适用于 API 15、16 和 17 的 MIPS(我没有低于 15。)花了大约 12 个小时的修补,但是它现在有效。

alternatively, you can use Genymotion as an emulator, however will most likely lose design abilities otherwise available with included emulators.或者,您可以使用 Genymotion 作为模拟器,但是很可能会失去设计能力,否则随附的模拟器可用。

It works now.它现在有效。 Pretty slow, but it works.很慢,但它有效。 Of course, once you have the emulator started, as long as you don't close it, it will be much faster.当然,一旦你启动了模拟器,只要不关闭它,速度会快很多。

You may need to restart Android studio, and I restarted my entire computer just for good measure.您可能需要重新启动 Android Studio,我重新启动了我的整个计算机只是为了更好地衡量。

Hope that helps.希望有帮助。

The newest version of the Android emulator can be run with Hyper-V instead of Intel HAXM on the Windows 10 1804:最新版本的 Android 模拟器可以在 Windows 10 1804 上使用 Hyper-V 而不是 Intel HAXM 运行:

https://blogs.msdn.microsoft.com/visualstudio/2018/05/08/hyper-v-android-emulator-support/ https://blogs.msdn.microsoft.com/visualstudio/2018/05/08/hyper-v-android-emulator-support/

Short version:精简版:

  • install Windows Hypervisor Platform feature安装 Windows 管理程序平台功能
  • Update to Android Emulator 27.2.7 or above更新到 Android Emulator 27.2.7 或更高版本
  • put WindowsHypervisorPlatform = on into C:\\Users\\.android\\advancedFeatures.ini or start emulator or command line with -feature WindowsHypervisorPlatform将 WindowsHypervisorPlatform = on 放入 C:\\Users\\.android\\advancedFeatures.ini 或使用 -feature WindowsHypervisorPlatform 启动模拟器或命令行

Windows 10 home version with latest android studio (Nov/2019):带有最新 android studio 的 Windows 10 家庭版(2019 年 11 月):

  1. Enable virtualization from BIOS.从 BIOS 启用虚拟化。 If you have a laptop, google how to access the BIOS.如果您有笔记本电脑,请谷歌搜索如何访问 BIOS。

  2. Enable via Windows Features: "Windows Hypervisor Platform".通过 Windows 功能启用:“Windows 管理程序平台”。 Restart.重新开始。 No need for Hyper-V and Win10 Pro.不需要 Hyper-V 和 Win10 Pro。

Done.完毕。 Open Android Studio, the annoying warning is gone, emulator starts just fine.打开Android Studio,烦人的警告消失了,模拟器启动就好了。

您需要做的第一件事是从 SDK 管理器和其他必要的软件包(如 platform-25 等)下载附加程序和工具包,然后打开 AVD 管理器并选择您不需要的任何模拟器,然后转到“其他图像”选项卡并选择 ARM AEBI a7a 系统映像并选择完成,您就完成了,希望这对您有所帮助。

You've probably heard of Bluestacks, and actually you can run and debug your android apps on the Bluestacks emulator.您可能听说过 Bluestacks,实际上您可以在 Bluestacks 模拟器上运行和调试您的 android 应用程序。 I think this is the best solution to the slow Android Studios emulator speed.我认为这是 Android Studios 模拟器速度缓慢的最佳解决方案。 Also next time think about buying an Intel processor instead.下次考虑购买英特尔处理器。 Look here for more information: Connect Bluestacks to Android Studio在此处查看更多信息: 将 Bluestacks 连接到 Android Studio

I am using the AMD processor and had the same issue.我正在使用 AMD 处理器并且遇到了同样的问题。 To solve this go to control panel-> turn windows features on or off -> check the hyper-V checkbox and click Ok and restart your computer.要解决此问题,请转到控制面板-> 打开或关闭 Windows 功能-> 选中 hyper-V 复选框,然后单击确定并重新启动计算机。 Now you can create virtual device现在您可以创建虚拟设备

Tuesday, December 3, 2019 2019 年 12 月 3 日,星期二

https://androidstudio.googleblog.com/2019/12/emulator-29211-and-amd-hypervisor-12-to.html https://androidstudio.googleblog.com/2019/12/emulator-29211-and-amd-hypervisor-12-to.html

Via AMD Hypervisor, we added support for running the emulator on AMD CPUs on Windows:通过 AMD Hypervisor,我们添加了对在 Windows 上的 AMD CPU 上运行模拟器的支持:

  • With CPU acceleration带 CPU 加速
  • Without requiring Hyper-V无需 Hyper-V
  • With speed on par with HAXM速度与 HAXM 相当

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

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