简体   繁体   English

无法运行 Android Studio 的模拟器

[英]Can't run Android Studio's Emulator

I guess it was because after run instrumented test file so become can't open Android Studio's emulator?我猜是因为运行检测文件后无法打开 Android Studio 的模拟器? But I am not sure.但我不确定。

Error message: Launching 'app' on No Devices.错误消息:在无设备上启动“应用程序”。 Error while waiting for device: The emulator process for AVD Pixel_4_XL_API_30 was killed.等待设备时出错:AVD Pixel_4_XL_API_30 的模拟器进程被杀死。

在此处输入图像描述

I used follow solution solved this problem.↓我使用以下解决方案解决了这个问题。↓

Tools -> SDK Manager -> SDK Tools (tab) -> Deselect 'Android Emulator' -> OK

Now, when you try to run your app, or launch device from AVD Manager, it will give the 'Install Emulator' error -> Click Ok. This will automatically download the correct version.

I experienced the same problem with emulator version 30.6.4 and Android Studio Arctic Fox 2020.3.1 Canary 15. I tried switching from Intel HAXM to Windows Hyper-V and re-installed all android build tool and emulator packages. I experienced the same problem with emulator version 30.6.4 and Android Studio Arctic Fox 2020.3.1 Canary 15. I tried switching from Intel HAXM to Windows Hyper-V and re-installed all android build tool and emulator packages. Afterwards it worked for a day.之后它工作了一天。

The second thing I tried is manually installing an older version (30.5.5) of the emulator which you can get from here .我尝试的第二件事是手动安装旧版本(30.5.5)的模拟器,你可以从这里获得。 Now Android Studio does not recognize my manual installation of the emulator and I can not start the AVD from the UI.现在 Android Studio 无法识别我手动安装的模拟器,我无法从 UI 启动 AVD。 However I can start it via cmd and install apps from within android studio without crashes (at least for the moment).但是我可以通过 cmd 启动它,并从 android 工作室中安装应用程序而不会崩溃(至少目前如此)。

Start your AVD with the following command (android/sdk/emulator):使用以下命令(android/sdk/emulator)启动您的 AVD:

emulator -avd <name-with-_-instead-of-spaces>

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

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