diff --git a/server/src/main/java/com/genymobile/scrcpy/ScrCpyServer.java b/server/src/main/java/com/genymobile/scrcpy/ScrCpyServer.java index 8089d6c5..2e18682a 100644 --- a/server/src/main/java/com/genymobile/scrcpy/ScrCpyServer.java +++ b/server/src/main/java/com/genymobile/scrcpy/ScrCpyServer.java @@ -42,12 +42,17 @@ public class ScrCpyServer { }).start(); } - public static void main(String... args) throws Exception { + private static Options createOptions(String... args) { Options options = new Options(); if (args.length > 0) { int maximumSize = Integer.parseInt(args[0]) & ~7; // multiple of 8 options.setMaximumSize(maximumSize); } + return options; + } + + public static void main(String... args) throws Exception { + Options options = createOptions(args); try { scrcpy(options); } catch (Throwable t) {