简体   繁体   中英

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.

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. But, when running my simple Hello-World-type application, that option is disabled. Accordingly, Ctrl+F2 has no effect.

Thought #2 - Close the emulator window, by right-clicking the emulator's icon in my task bar, and selecting "Close window." 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. 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. ["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:

  1. I had an Android emulator process (emulator-arm.ese *32) which hadn't terminated properly.

  2. 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).

The problem process stayed in Windows' Task Manager after I shut down Android Studio, and Task Manager's failed to kill it. So I rebooted my PC, and now everything seems to work OK.

Use the multitask button on the emulator itself to open the list of running apps, then click the "X" to close your app.

在此处输入图片说明

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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