简体   繁体   English

Android Emulator 在 M1 mac/Apple Silicon 上卡住了加载屏幕

[英]Android Emulator stuck loading screen on M1 mac/ Apple Silicon

I had downloaded Android Studio on my M1 MacBook air but I can't run the emulator and it just gives me an error.我已经在我的 M1 MacBook air 上下载了 Android Studio,但我无法运行模拟器,它只会给我一个错误。 I search Android Studio requirements for mac and it says that it requires mac os 10.10 or higher and a minimum of 2 GB disk space and 4GB of ram.我搜索 Mac 的 Android Studio 要求,它说它需要 mac os 10.10 或更高版本以及至少 2 GB 磁盘空间和 4 GB 内存。 Anyone have this issue and how do I solve it?任何人都有这个问题,我该如何解决?

I try download the arm image android studio it is stuck on the loading screen for the emulator.我尝试下载arm image android studio,它卡在模拟器的加载屏幕上。

在此处输入图像描述

As for now (19/11/2020) any of the Virtualization tools do not work with the new Apple M1 macs.截至目前(2020 年 11 月 19 日),任何虚拟化工具都不适用于新的 Apple M1 mac。 So things like docker, emulators etc. We might have to wait a bit until this is fully supported unfortunately.所以像 docker、模拟器等。不幸的是,我们可能不得不等一下,直到完全支持它。

Good news !好消息 !

Edit on 28th July 2021 🎉 🌈 2021 年 7 月 28 日编辑🎉 🌈

Apple Silicon Support苹果芯片支持

There is an arm64 release version available for Android Studio Arctic Fox (2020.3.1) You can download it here https://developer.android.com/studio/archive Android Studio Arctic Fox (2020.3.1)有一个arm64发布版本,您可以在此处下载https://developer.android.com/studio/archive

When NDK runs into Unknown host CPU architecture: arm64 you can solve it here当 NDK 遇到Unknown host CPU architecture: arm64你可以在这里解决

End of beta !测试结束! Thank you谢谢

Edit on March 2021 2021 年 3 月编辑

I can confirm, this preview of Emulator works properly https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html我可以确认,这个模拟器的预览工作正常https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html

In the blog there is a link to a private repo (2021-Jan-04).在博客中,有一个私人仓库的链接(2021 年 1 月 4 日)。 They moved repo to google and there you find V3 https://github.com/google/android-emulator-m1-preview/releases他们将 repo 移至谷歌,在那里你可以找到 V3 https://github.com/google/android-emulator-m1-preview/releases

Since v3 even audio-out works (no audio-in)由于 v3 甚至音频输出工作(没有音频输入)

Edit on 4th Feb 2021 2021 年 2 月 4 日编辑

Now audio in and out works properly https://github.com/741g/android-emulator-m1-preview/issues/10#issuecomment-773532762现在音频输入和输出正常工作https://github.com/741g/android-emulator-m1-preview/issues/10#issuecomment-773532762

Edit March 2021编辑 2021 年 3 月

You can simply use one of them and it's working out of the box您可以简单地使用其中一个,它开箱即用

在此处输入图像描述

在此处输入图像描述

On August release notes you can see on the emulator for Arm host section an entry where they said the support for M1 is in progress.在 8 月的发行说明中,您可以在 Arm 主机的模拟器部分看到一个条目,其中他们说对 M1 的支持正在进行中。 Check the link below: https://developer.android.com/studio/releases/emulator#emulator_for_arm64_hosts检查以下链接: https ://developer.android.com/studio/releases/emulator#emulator_for_arm64_hosts

As of today the android emulator is up and working on the Apple Silicon here's a working demo from a googler到今天为止,android 模拟器已经启动并在 Apple Silicon 上工作,这是来自 googler 的工作演示

在此处输入图像描述

source: https://twitter.com/GoogleLfy/status/1332474914398322689 And the known issues here: https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html来源: https ://twitter.com/GoogleLfy/status/1332474914398322689 这里的已知问题: https ://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html

we can expect the stable release by the end of 2020 here's a conversation about the same https://www.reddit.com/user/lfy_google/我们可以期待在 2020 年底发布稳定版 这是关于相同https://www.reddit.com/user/lfy_google/的对话

Android studio has still not released a modified version for M1 macs, the version you are running, was originally made for intel chips, and is running via rosetta2. Android studio 还没有发布M1 macs 的修改版本,你运行的版本,最初是为intel 芯片制作的,通过rosetta2 运行。 And rosetta does not support virtualisation, so you cant run emulator, but you could do all else coding stuff with minor bugs, for testing your code you may use a physical android device and it works just fine...please let me know if further problem exists...而且rosetta不支持虚拟化,所以你不能运行模拟器,但你可以做所有其他有小错误的编码工作,为了测试你的代码,你可以使用一个物理的android设备,它工作得很好......请让我知道如果进一步问题存在...

这是由 Android 开发人员完成的工作模拟器https://github.com/google/android-emulator-m1-preview它就像一个魅力

For other ARM devices , it should be involved as an Instruction Set problem, in that case you can go to the AVD Manager of your AS and when create new virtual device, make sure to download the system image with arm64-v8a ABI, which is shown as bellow.对于其他 ARM 设备,应该是指令集问题,这种情况下你可以去你的 AS 的 AVD 管理器,在创建新的虚拟设备时,一定要下载带有 arm64-v8a ABI 的系统映像,即如下图所示。

在此处输入图像描述

For Mac M1 chip , these arm64 images can not solve the problem and for now the best way is to wait Google release the compatible images.对于 Mac M1 芯片,这些 arm64 映像无法解决问题,目前最好的方法是等待 Google 发布兼容映像。

I heard that the emulator won't work due to arm architecture of the apple silicon.我听说由于苹果芯片的 arm 架构,模拟器无法工作。 Using a phone for debugging might be the only option.使用电话进行调试可能是唯一的选择。 I also heard that android studio were working on an update for the M1.我还听说 android studio 正在为 M1 进行更新。

这里有一个 Mac M1 模拟器的基本测试版github 链接

android studio have made a rough initial preview of the emulator running on Apple Silicon.More details are available in this link below android studio 对在 Apple Silicon 上运行的模拟器进行了粗略的初步预览。更多详细信息可在下面的此链接中找到

https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html

Also you can download DMG file from GitHub: https://github.com/741g/android-emulator-m1-preview您也可以从 GitHub 下载 DMG 文件: https ://github.com/741g/android-emulator-m1-preview

Android has released beta emulator for M1 chipset Android 发布了 M1 芯片组的测试版模拟器

Please check this think to beta release请检查此想法到 beta 版本

https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html?m=1 https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html?m=1

Currently, Android Studio only supports the HAXM Intel version (which isn't compatible with ARM processors) of virtualization, to run the emulator.目前,Android Studio 仅支持 HAXM Intel 版本(不兼容 ARM 处理器)的虚拟化来运行模拟器。 But maybe in the coming weeks they might release the compatible versions for apple silicon processors.但也许在接下来的几周内,他们可能会发布适用于苹果硅处理器的兼容版本。 Till then the only option is to use a physical device.到那时,唯一的选择是使用物理设备。

下一个文档中有一个 Android Emulator Apple Silicon Preview https://androidstudio.googleblog.com/2020/12/android-emulator-apple-silicon-preview.html

On my M1 machine, the emulator would get stuck ( not open ) and the dock icon would say 'qemu-system-aarch64' and then that was it.在我的 M1 机器上,模拟器会卡住(未打开),停靠图标会显示“qemu-system-aarch64”,然后就是这样。

I managed to get the emulator to start by running it via the terminal and adding the gpu host flag我设法通过终端运行模拟器并添加 gpu 主机标志来启动它

emulator -gpu host -avd Pixel_5_API_32

PS I couldn't find the right stack issue, so I'm leaving this here. PS我找不到正确的堆栈问题,所以我把它留在这里。

It's because the new M1 chips run on arm Architecture and not x86.这是因为新的 M1 芯片在 arm 架构而不是 x86 上运行。 You have to download the arm compatible virtual devices those are available in the other images tab inorder to run those emulators.您必须下载其他图像选项卡中可用的 arm 兼容虚拟设备才能运行这些模拟器。

Also try this:也试试这个:

  1. Wipe data of the virtual device by right clicking it in AVD Manager, then rerun the project.通过在 AVD Manager 中右键单击来擦除虚拟设备的数据,然后重新运行项目。
  2. Check the Android Emulator box in SDK Manager -> SDK Tools选中 SDK Manager -> SDK Tools 中的 Android Emulator 框

I had downloaded Android Studio on my M1 MacBook air but I can't run the emulator and it just gives me an error.我已经在M1 MacBook Air上下载了Android Studio,但无法运行模拟器,这只会给我一个错误。 I search Android Studio requirements for mac and it says that it requires mac os 10.10 or higher and a minimum of 2 GB disk space and 4GB of ram.我在Mac上搜索Android Studio要求,并说它需要mac os 10.10或更高版本,并且至少需要2 GB磁盘空间和4GB内存。 Anyone have this issue and how do I solve it?任何人都有这个问题,我该如何解决?

I try download the arm image android studio it is stuck on the loading screen for the emulator.我尝试下载手臂图像android studio,它被卡在模拟器的加载屏幕上。

在此处输入图片说明

https://github.com/741g/android-emulator-m1-preview/releases下载 android-emulator-m1-preview.dmg

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

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