How do I restart an android emulator?
AndroidAdbAndroid Problem Overview
I'm basically trying to do this: https://stackoverflow.com/questions/2417427/changing-the-android-emulator-locale-automatically
Everything works up until 'start'. the emulator starts to boot but keeps loading at the shimmering 'ANDROID' screen forever. I must be missing something... How can I restart the emulator from ADB?
Okay, I should be more specific.
I am trying to do this from the command line using adb. I can use adb to setprop and I can stop the emulator. When I try doing 'start' in the adb shell, the emulator does begin to boot, but it never returns to the lock screen.
Android Solutions
Solution 1 - Android
In Android Studio go to:
Tools > Android > AVD Manager
- Select your emulator device
- Click "Cold boot now" to restart, or "Wipe data" to factory reset
Solution 2 - Android
you can try
emulator @avd_name -no-snapshot-load
it will clean load the device it worked for me.
Solution 3 - Android
You asked how to restart the emulator from ADB. But the title is framed in a way that pops the question up when searching about restarting it from the UI as well.
One option could be (but it depends on which tooling you are using and may not be available for all emulators/environments) is to tap and hold the Power button and then a menu will pop up with a Restart option in it.
This was a long-standing default behavior, but since Android 12 / API 31 it tries to open the Google Assistant instead (even when there's no such thing on emulators without Google APIs or Google Play ). The old behavior can be reverted by going to Settings > System > Gestures > "Press and hold power button" to bring up the menu in the screenshot.
Solution 4 - Android
To restart a running emulator I used
adb -e reboot
(Assuming there is only one running)
Solution 5 - Android
I'm pretty sure this will work:
-
Clear/Wipe the AVD to defaults or create a new one.
-
Start the AVD/Emulator from the CLI with the following command
emulator -avd my_avd -prop persist.sys.language=en -prop persist.sys.country=GB
change as needed. That way you are not messing with the system image which can cause hangs/crashes. And you can easily set it on boot for a variety of Locales.
Solution 6 - Android
If you are using Android Studio, you can goto the AVD Manager, Under Actions select "Cold Boot Now" to restart the emulator. This would get rid of errors/discrepancies which might occur if the simulator's process has been abruptly closed/terminated.
Solution 7 - Android
For me, kiran-chenna's answer failed me, and the solution was to instead run:
emulator -avd Pixel_2_API_28 -no-cache
Solution 8 - Android
In my case, a cold boot was required after the emulator got stuck. It can be found in the Android Virtual Device Manager.
Solution 9 - Android
Follow the following steps to restart/cold-boot your virtual device:
- Open Android Studio
- Click on Configure
- Click AVD Manager
- Click on the Dropdown on the right hand side of the virtual device.
- Click on Cold Boot Now
You're done! The device will restart within a couple of minutes.
Solution 10 - Android
To start/stop or restart emulator follow these steps:
using telnet on windows machine
o localhost 5554
avd start start
or
avd start restart
or
avd stop
Solution 11 - Android
Some versions of the emulator (android-7) are buggy and just hang at the shimmmera.
Try restarting it with "wipe user data" option (yes, you will have to re-run your app or at least reinstall it).
Solution 12 - Android
2022 Android Studio Bumblebee: With the emulated device open on screen (the "Emulator" tab open), press and hold the power button at the top of window just as you would on a real device, and it will pop up the device's menu just as if you had held the button on the side of a real device. For example:
Solution 13 - Android
you can restart the emulator from adb shell, start the emulator and also adb shell in the terminal.
start Starts (restarts) an emulator/device instance. stop Stops execution of an emulator/device instance.
Solution 14 - Android
in eclipse in the top most right u will find DDMS go i there, left side you will find Devices and in that in the last you will find a triangle downwards press that in that you will find Reset adb.