如何防止 android 设备进入睡眠状态(通过 adb 命令 shell)

How to prevent an android device from entering sleep (via adb command shell)

我正在开发带有 android 的嵌入式电路板。不幸的是,我无法使用显示器,因为我没有支持的显示设备(LVDS 显示器)。

问题:

每次我启动设备时,设备都会在一段时间后进入睡眠状态。

Restarting tasks ... done.
PM: suspend exit 1970-01-01 00:35:30.797352016 UTC
PM: suspend entry 1970-01-01 00:35:30.905410683 UTC
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.002 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
Suspending console(s) (use no_console_suspend to debug)

如何避免出现 shell 提示?我可以通过串口登录shell。

我无法修改设置,因为我无权显示。

$ adb shell svc power stayon true