10

I need to test the behavior of my app in sleep mode. How to enable sleep mode, I found in this Stackoverflow article. As stated, about 1min after the screen of emulator goes to black.

The problem is now, I cannot wake the emulator back up again. No clicking and not hotkeys (F7, CTRL+H, etc.) What do I do wrong. Or do I habe a misunderstanding with the sleep mode, in general.

In principle, I could use a real device, but here I have not control when the phones goes to (deep) sleep, what makes it difficult to test.

5
  • Do you use Mac? Feb 8, 2017 at 10:01
  • Sorry, forgot to add: Ubuntu 16.04.
    – Christian
    Feb 8, 2017 at 10:17
  • 1
    I have the same problem. I cannot wake the emulator by pressing the power button. I turned off "stay awake" in the dev options (I need it to test my app). I'm using Mac and emulator 26.0.0 on nexus 5X API 25 x86.
    – Stan
    May 3, 2017 at 19:41
  • 1
    The problem is not always reproducible though, it seems to happen rarely (not sure under what conditions).
    – Stan
    May 3, 2017 at 19:48
  • I'm getting the same behavior on Android Emulator 4.2.2 (SDK 17) running on Windows 10. Once it gets to sleep mode, it never returns back no matter if my application under test is running or not.
    – pepan
    Jun 15, 2021 at 14:31

4 Answers 4

3

I found that calling the emulator actually wakes up the phone as well.

android emulator call function

2
  • As stupid as this is, it's the only thing I've found that works. Thanks. +1 Nov 27, 2018 at 3:24
  • Not working in Marshmallow (need try a lot of thing and reboot to works), but Nougat works.
    – 林果皞
    Mar 22, 2019 at 9:19
1

I solved by checking "Stay awake" in "Settings -> Developer options -> Stay awake (screen will never sleep while charting)". And make sure set in emulator settings UI "(three dots) -> Battery -> Charger connection -> AC Charger"

1
  • 1
    The problem is the initial question was related to observe the behavior when the phone enters sleep mode. Your solution practically does not allow the phone to enter the sleep mode.
    – Alex
    Jul 3, 2018 at 7:45
0

I also saw this problem with old Android version emulators (4.2, 4.3). If u actually wait for 20-30 seconds , emulator does wake up :) I dont know why so long...

0

I found that closing the Emulator and then restarting in the Android Device Manager got it back on for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.