How to simulate sleep mode on Android emulator

前端 未结 6 1805
遇见更好的自我
遇见更好的自我 2020-12-30 19:36

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

6条回答
  •  轮回少年
    2020-12-30 20:04

    Somehow fn + F7 doesn't work on my mac. So what I use instead is:

    adb shell input keyevent 26

    This sends the POWER KEY event and will turn off the screen. Note: It will not show that the screen is off. Image wills tay. But you can't interact with it. As soon as you do adb shell input keyevent 26 again, you will see the lock screen indicating, that the device was off before.

提交回复
热议问题