Skip to content

Commit

Permalink
模拟器添加Genymotion支持
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhaoZuohong committed Jul 18, 2024
1 parent e672efa commit 691336c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arknights_mower/utils/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Simulator_Type(Enum):
Waydroid = "Waydroid"
ReDroid = "ReDroid"
MuMuPro = "MuMuPro"
Genymotion = "GenyMotion"


def restart_simulator(stop=True, start=True):
Expand All @@ -31,6 +32,7 @@ def restart_simulator(stop=True, start=True):
Simulator_Type.Waydroid.value,
Simulator_Type.ReDroid.value,
Simulator_Type.MuMuPro.value,
Simulator_Type.Genymotion.value,
]:
if simulator_type == Simulator_Type.Nox.value:
cmd = "Nox.exe"
Expand All @@ -54,6 +56,8 @@ def restart_simulator(stop=True, start=True):
cmd = f"docker stop {data['index']} -t 0"
elif simulator_type == Simulator_Type.MuMuPro.value:
cmd = f"Contents/MacOS/mumutool close {data['index']}"
elif simulator_type == Simulator_Type.Genymotion.value:
cmd = f"gmtool admin start {data['index']}"
if stop:
exec_cmd(cmd, data["simulator_folder"])
logger.info(f"关闭{simulator_type}模拟器")
Expand All @@ -73,6 +77,8 @@ def restart_simulator(stop=True, start=True):
cmd = f"docker start {data['index']}"
elif simulator_type == Simulator_Type.MuMuPro.value:
cmd = cmd.replace("close", "open")
elif simulator_type == Simulator_Type.Genymotion.value:
cmd = f"gmtool admin stop {data['index']}"
if start:
exec_cmd(cmd, data["simulator_folder"])
logger.info(f"开始启动{simulator_type}模拟器,等待{data['wait_time']}秒")
Expand Down
1 change: 1 addition & 0 deletions ui/src/pages/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const simulator_types = [
{ label: '雷电模拟器9', value: '雷电9' },
{ label: 'ReDroid', value: 'ReDroid' },
{ label: 'MuMu模拟器Pro', value: 'MuMuPro' },
{ label: 'Genymotion', value: 'Genymotion' },
{ label: '其它', value: '' }
]
Expand Down

0 comments on commit 691336c

Please sign in to comment.