我想测试 App 待机模式。我使用的设备是 Galaxy S7 edge 和配备 Android 6.0(API 级别 23)的虚拟设备。
我使用:
$ adb shell dumpsys battery unplug
$ adb shell am set-inactive <packageName> true
当我使用 adb shell am get-inactive <packageName>
测试应用是否真的处于待机状态时我总是得到以下结果 Idle=false
.有没有其他人经历过同样的行为?
最佳答案
为时已晚,但我遇到了同样的问题。
我想通了,只需删除 <>
.
意思是-> adb shell am set-inactive packageName true
喜欢
adb shell am set-inactive com.abc.abcd true
不是
adb shell am set-inactive <com.abc.abcd> true
关于android - “adb shell am set-inactive <packageName> true “does' t 工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37988676/