From 890ba529c38c8a803c8a1b65fa4d2d2a34bae7b5 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Tue, 21 Nov 2023 15:08:04 +0100 Subject: [PATCH] Keep server file on the device until clean up 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. --- server/src/main/java/com/genymobile/scrcpy/CleanUp.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/CleanUp.java b/server/src/main/java/com/genymobile/scrcpy/CleanUp.java index b3a1aac13e..8be413ca21 100644 --- a/server/src/main/java/com/genymobile/scrcpy/CleanUp.java +++ b/server/src/main/java/com/genymobile/scrcpy/CleanUp.java @@ -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(); @@ -187,5 +185,7 @@ public static void main(String... args) { Device.setScreenPowerMode(Device.POWER_MODE_NORMAL); } } + + unlinkSelf(); } }