Developer tips

Virtual display using scrcpy

It’s possible to use a tool like scrcpy to show a virtual display. See their GitHub page for more information.

Power management

turn off the screen

After the device boots, the screen will stay on all the time. This won’t let the kernel to enter its default suspend state.

To avoid that, you can tell the power manager to disable holding the screen on:

svc power stayon false

stay awake

If you want to keep the scree on all the time you can tell the power manager to stay awake:

svc power stayon true

Alternatively, you can hold a wakelock via the commandline:

echo lock_me > /sys/power/wake_lock
echo lock_me > /sys/power/wake_unlock