Skip to main content
Version: next

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 showTouches setting to its original state
  • Restoring the stayAwake setting to its original state
  • Restoring the screen timeout setting modified by screenOffTimeout to 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.

  • showTouches: Shows visual feedback for touches on the device screen
  • stayAwake: 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
});