cleanup
info
Added in Scrcpy 1.23
- Type:
boolean - Default value:
true
Controls whether the server should perform cleanup tasks on exit.
By default, cleanup is enabled in Scrcpy, meaning the server will perform various cleanup tasks when closing the connection. These tasks include:
- Deleting the scrcpy-server file from device storage
- Restoring the
showTouchessetting to its original state - Restoring the
stayAwakesetting to its original state - Restoring the screen timeout setting modified by
screenOffTimeoutto its original state
Adding this option with a value of true has no effect since this is the default behavior. Only setting this option to false will disable these cleanup tasks on exit.
Related options
showTouches: Shows visual feedback for touches on the device screenstayAwake: Prevents the device from sleeping while screen casting is active
Example
import { ScrcpyOptions1_23 } from "@yume-chan/scrcpy";
const options = new ScrcpyOptions1_23({
cleanup: false, // Disable cleanup on exit
});