Some command line arguments perform actions on the device itself while scrcpy is running.
To prevent the device from sleeping after a delay when the device is plugged in:
scrcpy --stay-awake
scrcpy -wThe initial state is restored when scrcpy is closed.
If the device is not plugged in (i.e. only connected over TCP/IP),
--stay-awake has no effect (this is the Android behavior).
It is possible to turn the device screen off while mirroring on start with a command-line option:
scrcpy --turn-screen-off
scrcpy -S # short versionOr by pressing MOD+o at any time (see shortcuts).
To turn it back on, press MOD+Shift+o.
On Android, the POWER button always turns the screen on. For convenience, if
POWER is sent via scrcpy (via right-click or MOD+p),
it will force to turn the screen off after a small delay (on a best effort
basis). The physical POWER button will still cause the screen to be turned on.
It can also be useful to prevent the device from sleeping:
scrcpy --turn-screen-off --stay-awake
scrcpy -Sw # short versionFor presentations, it may be useful to show physical touches (on the physical device). Android exposes this feature in Developers options.
Scrcpy provides an option to enable this feature on start and restore the initial value on exit:
scrcpy --show-touches
scrcpy -t # short versionNote that it only shows physical touches (by a finger on the device).
To turn the device screen off when closing scrcpy:
scrcpy --power-off-on-closeBy default, on start, the device is powered on. To prevent this behavior:
scrcpy --no-power-on