Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
225 views
in Technique[技术] by (71.8m points)

How to simulate sleep mode on Android emulator

Some users of my Android application report bugs when the mobile enters sleep/power saving mode.

I would like to test that issue on the Android Virtual Device. Is it possible to simulate the mobile entering in sleep/power saving mode on the AVD ?

Thanks in advance.

question from:https://stackoverflow.com/questions/10476373/how-to-simulate-sleep-mode-on-android-emulator

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Try the following on emulator

  1. Go to Settings
  2. Go to Developer options
  3. Un-check Stay awake (3rd option from the top)

The emulator will go to sleep after 1 min (default setting) if not changed.

Press the power button enter image description here to wake up the emulator.

Developer options is not enabled by default, to enable it, do the following:

  1. Go to Settings
  2. Click About emulated device
  3. Click Build number 7 times, you should be notified that Developer options is now enabled
  4. Go back and you should see Developer options

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...