简体   繁体   English

Mac上的Android Studio模拟器崩溃(非特定的错误日志,监视器发出奇怪的声音)。 卸载设备?

[英]Android Studio Emulator crashing on Mac (non-specific error log, strange sounds from monitor). Uninstall devices?

I was working in Android Studio, and I've been having problems with the emulated devices shutting themselves down properly, causing me to have to Force Quit them and start another device emulation. 我当时在Android Studio中工作,但在模拟设备正常关闭时遇到了问题,导致我不得不强制退出它们并开始另一个设备模拟。 When that happens, Android Studio still registers the emulator as connected and running. 发生这种情况时,Android Studio仍会将模拟器注册为已连接并正在运行。

In the process of testing my app, I accidentally tried to run the app on one of the emulators I had Force Quit earlier, and this caused Android Studio to freeze completely. 在测试我的应用程序的过程中,我意外地尝试在我之前强制退出的其中一个模拟器上运行该应用程序,这导致Android Studio完全冻结。 I had no choice but to Force Quit the entirety of Android Studio. 我别无选择,只能强制退出整个Android Studio。 After restarting the app, everything was slow and mostly unresponsive, so I decided to restart my Mac. 重新启动应用程序后,一切都很缓慢并且几乎没有响应,因此我决定重新启动Mac。

After that, Android studio runs fine as it should, but none of my emulators will run. 之后,Android Studio可以正常运行,但是我的模拟器都无法运行。 I start the emulator, then this weird rhythmic static sound starts coming out of my second monitor until I turn it off and turn it back on. 我启动了模拟器,然后这种奇怪的有节奏的静态声音开始从第二个监视器发出,直到我将其关闭然后重新打开。 The emulator crashes, OS X throws up an error asking if I want to reopen it, and the log spits out some unspecified cpu error. 模拟器崩溃,OS X引发错误,询问我是否要重新打开它,并且日志吐出一些未指定的cpu错误。

So obviously the Force Quit that I was forced to do earlier today really messed things up, because I've never had this problem before. 很明显,我今天早些时候被迫去做的《部队退出》确实把事情搞砸了,因为我以前从未遇到过这个问题。 I've seen lots of different answers to similar problems, but I don't want to get rid of more than I have to. 对于相似的问题,我已经看到了许多不同的答案,但是我不想摆脱不必要的麻烦。 I tried uninstalling Android Studio the usual way (deleting the app), and then reinstalling, but that didn't change anything. 我尝试以通常的方式(删除应用程序)卸载Android Studio,然后重新安装,但这没有任何改变。

There are lots of things about how to remove the 'deeper' elements of the app, but I'm not sure what the end result will be, or what exactly I should do to fix this specific problem. 关于如何删除应用程序的“更深层”元素,有很多事情,但是我不确定最终结果是什么,或者我应该怎么做才能解决此特定问题。 Is there a way to rebuild/reinstall the emulators without getting rid of anything else? 有没有一种方法可以重建/重新安装仿真器而又没有其他问题呢? One answer had terminal instructions on how to do this, but it also wipes the keystore. 一个答案有关于如何执行此操作的终端说明,但是它也擦除了密钥库。

I already have an app in the Play store, and I don't want to mess up anything. 我已经在Play商店中拥有一个应用,并且我不想弄乱任何东西。 I do have the .jks file in with my app files, but I'm not sure exactly what will happen if I follow the instructions in the answers I've seen already. 我的应用程序文件中确实包含.jks文件,但是我不确定如果按照已经看到的答案中的说明进行操作,将会发生什么情况。

Any help would be much appreciated, because my work is at a stand-still now until I can get these emulators/simulators running again. 任何帮助将不胜感激,因为我的工作现在停滞不前,直到我可以再次运行这些模拟器为止。

In the last months I had a few occasions where my emulators were misbehaving, they would consume a lot of CPU while doing nothing. 在过去的几个月中,我有几次仿真器行为异常,它们会在不执行任何操作的同时消耗大量CPU。 However I don't have a second monitor and I didn't hear anything. 但是,我没有第二台显示器,也听不到任何声音。

The way I checked was opening a terminal and running top , but you may do that in different ways as well. 我检查的方式是打开终端并运行top ,但是您也可以用不同的方式进行操作。 Once I found the offending process pid I killed it from terminal and my iMac got responsive again. 一旦发现有问题的进程pid,我便从终端将其杀死,iMac再次响应。 Opening the same emulator again was ok. 再次打开相同的模拟器是可以的。

There were also other occasions when I had emulators not running apps properly. 在其他情况下,当我的模拟器无法正确运行应用程序时。 The solution here was deleting that emulator and creating a new one with the same configuration, which usually works for me. 此处的解决方案是删除该模拟器,并使用相同的配置创建一个新的模拟器,通常对我有用。 That happened a lot when google started releasing the first android N previews, although I didn't use any N emulator back then. 当Google开始发布第一个android N预览版时,发生了很多事情,尽管那时我没有使用任何N模拟器。

Another step further is cleaning the android sdk manager, that's the guy who downloads/updates things like emulator images and sdk versions for you. 进一步的步骤是清理android sdk管理器,这是为您下载/更新模拟器图像和sdk版本之类的人。 Open Android Studio, click on SDK manager, click on "Launch Standalone SDK Manager". 打开Android Studio,单击SDK管理器,然后单击“启动独立SDK管理器”。 A new window shouod pop up, and you can see the path where it's installed at the top. 将会弹出一个新窗口,您可以在顶部看到其安装路径。 In case you want to wipe it out just open finder on that path, delete everything and download a new SDK Manager from google. 如果您要清除它,只需在该路径上打开finder,删除所有内容,然后从Google下载新的SDK Manager。 BTW I always download this before Android Studio and keep it in a separate path. 顺便说一句,我总是在Android Studio之前下载此文件,并将其保存在单独的路径中。 Remember to close and reopen Android Studio, and when it complains about not finding the SDK manager gently show it where it is. 请记住要关闭并重新打开Android Studio,当它抱怨找不到SDK管理器时,请轻轻地显示它所在的位置。

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

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