Skip to content

Commit

Permalink
Keep server file on the device until clean up
Browse files Browse the repository at this point in the history
The server was unlinked (removed) just after it started.

In order to execute a new process using the server jarfile at any time
(typically to set the display power mode from another process), keep the
file until the server closes.
  • Loading branch information
rom1v committed Nov 21, 2023
1 parent 798727a commit 890ba52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/main/java/com/genymobile/scrcpy/CleanUp.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ public static void unlinkSelf() {
}

public static void main(String... args) {
unlinkSelf();

try {
// Wait for the server to die
System.in.read();
Expand Down Expand Up @@ -187,5 +185,7 @@ public static void main(String... args) {
Device.setScreenPowerMode(Device.POWER_MODE_NORMAL);
}
}

unlinkSelf();
}
}

0 comments on commit 890ba52

Please sign in to comment.