Skip to content

Commit

Permalink
Add command to restart ADB server (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pbatch authored Jul 4, 2024
1 parent af48b27 commit 075a8d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions clashroyalebuildabot/emulator/emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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/"])

Expand Down

0 comments on commit 075a8d3

Please sign in to comment.