'Android Emulator got stuck at "shutting down"

The emulator in my android studio keeps showing "shutting down". I try closing it and run again, restarting my mac, but nothing worked, each time I run it, it shows "shutting down" again. even though I can see actions running below (very blur) enter image description here



Solution 1:[1]

  • Click on Tools
  • Click on AVD Manager
  • Click on the dropdown arrow next to the AVD which is stuck
  • Click on cold boot now

This issue occurs when we forcibly exit an unresponsive/stuck AVD. AVD manager saves the state before it is forcibly exited and on the next start it continues from the unresponsive/stuck state. This is useful when we need the AVD to boot up quickly, however if you want to disable this feature entirely then follow the steps below:

  • In the AVD manager, click on the pencil icon
  • A new window will pop up. Click on show advanced settings
  • Scroll down to the emulated performance section
  • Next to boot option, select cold boot

Solution 2:[2]

I run my emulator with cold boot by command line

cd C:\Users\<your_user_name>\AppData\Local\Android\Sdk\emulator
emulator -list-avds
emulator -avd <your_adb_name> -no-snapshot-load

Solution 3:[3]

If the cold boot or wipe data does not work, you can try deleting the lock file. Then quit the emulator, and restart it.

In my case, AVD Manager prompted me to delete the following files, I did it, and the problem was solved.

enter image description here

Solution 4:[4]

If it shows "AVD *** is already running etc." then just connect any mobile device that after enabling debugging mode and run your app in a physical device instead of an emulator then
Click on Tools Click on AVD Manager Click on the dropdown arrow next to the AVD which is stuck Click on cold boot now

Solution 5:[5]

  • First of all: You have to close the window, or tab of your Virtual Appliance.
    With this you get Android Studio to standby the Device and unlock the ADV (Android Virtual Device) files, so you can manipulate the virtualization.

Maybe you have to wait until Android Studio kill the process. If Android doesn't do this automatic, you will have to close Android Studio and delete C:\Users{YOUR_USER}.android\avd{YOUR_DEVICE_NAME}.avd and within this folder delete all files and folders with extension .lock to stay secure before start again Android Studio.

  • After that: Just open the Device Manager, and click on the down arrow in the Actions section for your device, and select Cold Boot Now. This reload the Virtual Device without start or open any program.

  • Finally: If Cold Boot Now worked fine, now you can run or debug your application to check that it functions perfectly. Without the device continuing with the problem that the system is still stuck/frozen.

And also you do not need to do a Wipe Data, so you do not delete the data of your application, since you can have any internal database in SQLite, which has the changes and advances that you have been implementing or creating during the development of your application for its operation.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 pythonista
Solution 2 Bauroziq
Solution 3 Vincent Sit
Solution 4 Muhammad Usman
Solution 5