How to simulate sleep mode on Android emulator(如何在 Android 模拟器上模拟睡眠模式)
问题描述
当手机进入睡眠/省电模式时,我的 Android 应用程序的一些用户报告了错误.
Some users of my Android application report bugs when the mobile enters sleep/power saving mode.
我想在 Android 虚拟设备上测试该问题.是否可以在 AVD 上模拟手机进入睡眠/省电模式?
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 ?
提前致谢.
推荐答案
在模拟器上试试下面的
- 转到
设置 - 转到
开发者选项 - 取消选中
保持清醒(从顶部开始的第三个选项)
- Go to
Settings - Go to
Developer options - Un-check
Stay awake(3rd option from the top)
如果不更改,模拟器将在 1 分钟(默认设置)后进入睡眠状态.
The emulator will go to sleep after 1 min (default setting) if not changed.
按下电源按钮 唤醒模拟器.
Press the power button to wake up the emulator.
开发者选项默认不启用,要启用它,请执行以下操作:
Developer options is not enabled by default, to enable it, do the following:
- 转到
设置 - 点击
关于模拟设备 - 点击
Build number7 次,应该会通知您Developer options现已启用 - 返回,你应该会看到
开发者选项
- Go to
Settings - Click
About emulated device - Click
Build number7 times, you should be notified thatDeveloper optionsis now enabled - Go back and you should see
Developer options
这篇关于如何在 Android 模拟器上模拟睡眠模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 Android 模拟器上模拟睡眠模式
基础教程推荐
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
