[英]How to stop emulated app from running? (Android Studio, 64-bit Win7 SP1)
Running Your App -> Run on the Emulator clearly explains how to RUN an app from within Android Studio by launching the emulator. 运行您的应用程序->在模拟器上运行清楚地说明了如何通过启动模拟器在Android Studio中运行应用程序。
My question is - Once I've done that: "How should I STOP the emulated app from running?" 我的问题是-完成此操作后:“如何停止运行仿真应用程序?”
Thought #1 - Use the "Run -> Stop (Ctrl + F2)" option on Android Studio's menu. 思想#1-使用Android Studio菜单上的“运行->停止(Ctrl + F2)”选项。 But, when running my simple Hello-World-type application, that option is disabled. 但是,当运行我的简单Hello-World类型应用程序时,该选项被禁用。 Accordingly, Ctrl+F2 has no effect. 因此,Ctrl + F2无效。
Thought #2 - Close the emulator window, by right-clicking the emulator's icon in my task bar, and selecting "Close window." 思想#2-通过右键单击任务栏中的仿真器图标,然后选择“关闭窗口”,关闭仿真器窗口。 That closed the application all right, but then it seemed to leave things in a strange state. 那完全关闭了应用程序,但是随后似乎使事情陷入了一种奇怪的状态。 -- When I tried to run the application again, it gave an error and I had to recreate the project. -当我尝试再次运行该应用程序时,出现了错误,我不得不重新创建该项目。 That happened repeatably. 那件事反复发生。
Thought #3 - Try shutting down the (emulated) Android device. 思想#3-尝试关闭(模拟的)Android设备。 I tried that on Saturday evening: I held down the (emulated) Power button. 我在星期六晚上尝试过:我按下(模拟)电源按钮。 Clicked the option in the "Device options" window. 单击“设备选项”窗口中的选项。 It's now Monday morning, and it still says that it's "Shutting down...". 现在是星期一早上,它仍然说是“正在关机……”。
So, "How should I stop the emulated app from running?" 因此,“如何停止仿真应用程序运行?”
Thank you for any suggestions/help you can provide. 感谢您提供的任何建议/帮助。
Russell
I now see that I had asked the wrong question. 我现在看到我问错了问题。 I should have asked how to stop a running emulator. 我应该问过如何停止正在运行的模拟器。
Although I had been able to do so by right-clicking the emulator's entry in the task bar, and selecting "Close window", that had SEEMED to cause some problems. 尽管我可以通过右键单击任务栏中的仿真器条目并选择“关闭窗口”来做到这一点,但SEEMED可能会引起一些问题。 ["The selected device is incompatible" was displayed in the "Device Chooser" dialog.] So, I thought that was the wrong way to do it. [在“设备选择器”对话框中显示了“所选设备不兼容”。]因此,我认为这样做是错误的方法。
Since then, though, I think I've figured out that something else was causing my problems: 从那以后,尽管如此,我认为我发现其他原因导致了我的问题:
I had an Android emulator process (emulator-arm.ese *32) which hadn't terminated properly. 我有一个Android模拟器进程(emulator-arm.ese * 32),该进程没有正确终止。
When I selected another device, I hadn't given the (slow) Android emulator enough time to clear the "The selected device is incompatible" error(s). 当我选择另一台设备时,我没有给(慢)Android模拟器足够的时间来清除“所选设备不兼容”错误。
The problem process stayed in Windows' Task Manager after I shut down Android Studio, and Task Manager's failed to kill it. 我关闭Android Studio后,问题过程仍然留在Windows的任务管理器中,并且任务管理器无法将其杀死。 So I rebooted my PC, and now everything seems to work OK. 因此,我重新启动了PC,现在一切正常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.