diff --git a/clashroyalebuildabot/emulator/emulator.py b/clashroyalebuildabot/emulator/emulator.py index 683b5ea..69b68cd 100644 --- a/clashroyalebuildabot/emulator/emulator.py +++ b/clashroyalebuildabot/emulator/emulator.py @@ -113,6 +113,7 @@ def __init__(self): self.forward_port = get_free_port() self._install_adb() + self._restart_server() self.width, self.height = self._get_width_and_height() self._copy_scrcpy() self._forward_port() @@ -201,6 +202,14 @@ def _run_command(self, command): return result.stdout + def _restart_server(self): + self._run_command( + [ + "kill-server", + ] + ) + self._run_command(["start-server"]) + def _copy_scrcpy(self): self._run_command(["push", "scrcpy-server.jar", "/data/local/tmp/"])