By default, the Java process exits when all non-daemon threads are terminated. The Android SDK might start some non-daemon threads internally, preventing the scrcpy server to exit in some cases. So force the process to exit explicitly.