Android Emulator got stuck at "shutting down"

Viewed 3680

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

6 Answers
  • 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

  • open AVD Manager Dialog from top right corner
  • go to your emulator
  • click on the last icon on the right which is a drop down button
  • Click wipe data

Important Note: this will delete all data on that emulator and give it a fresh install again and might solve your problem

If that didn't work then check that you have enough rams to run both the emulator and the android studio.

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

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

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

  • 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.

Related