gpt4 book ai didi

android - 如何在 root 的 android 设备上关闭屏幕?

转载 作者:太空宇宙 更新时间:2023-11-03 12:18:19 26 4
gpt4 key购买 nike

我有一个 root 的 android 设备。我希望在预定的时间关闭它的显示。

我如何以编程方式关闭屏幕?我们可以使用 Linux 命令来完成吗?

谢谢。

最佳答案

可以使用,adb shell input keyevent

用法:

adb shell input keyevent [--longpress] <key code number or name>

要关闭屏幕,请使用键码

26 -->  "KEYCODE_POWER"`

根据您的提示运行:

root@user:/$ adb shell input keyevent 26   

或者这个,

root@user:/$ adb shell input keyevent KEYCODE_POWER

从您的函数/方法运行上述命令: Execute ADB Command through Android Application .

此过程也适用于非 Root 设备。

完整的事件列表:See Here
设置亚行:See Here

关于android - 如何在 root 的 android 设备上关闭屏幕?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25840976/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com