mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2025-12-16 11:15:13 +00:00
feat: start and exit ldplayer9
This commit is contained in:
parent
a005a46a41
commit
7aeccc9d96
@ -12,6 +12,7 @@ from module.device.platform.platform_base import PlatformBase
|
||||
from module.device.platform.emulator_windows import Emulator, EmulatorInstance, EmulatorManager
|
||||
from module.logger import logger
|
||||
|
||||
import os
|
||||
|
||||
class EmulatorUnknown(Exception):
|
||||
pass
|
||||
@ -101,6 +102,11 @@ class PlatformWindows(PlatformBase, EmulatorManager):
|
||||
elif instance == Emulator.BlueStacks4:
|
||||
# BlueStacks\Client\Bluestacks.exe -vmname Android_1
|
||||
self.execute(f'"{exe}" -vmname {instance.name}')
|
||||
elif instance == Emulator.LDPlayer9:
|
||||
directory, filename = os.path.split(exe)
|
||||
new_filename = 'ldconsole.exe'
|
||||
exe = os.path.join(directory, new_filename)
|
||||
self.execute(f'"{exe}" launch --index {instance.name.replace("leidian", "")}')
|
||||
else:
|
||||
raise EmulatorUnknown(f'Cannot start an unknown emulator instance: {instance}')
|
||||
|
||||
@ -155,6 +161,11 @@ class PlatformWindows(PlatformBase, EmulatorManager):
|
||||
self.execute(f'"{exe}" -clone:{instance.name} -quit')
|
||||
elif instance == Emulator.BlueStacks5:
|
||||
self.execute(f'taskkill /fi "WINDOWTITLE eq {instance.name}" /IM "HD-Player.exe" /F')
|
||||
elif instance == Emulator.LDPlayer9:
|
||||
directory, filename = os.path.split(exe)
|
||||
new_filename = 'ldconsole.exe'
|
||||
exe = os.path.join(directory, new_filename)
|
||||
self.execute(f'"{exe}" quit --index {instance.name.replace("leidian", "")}')
|
||||
else:
|
||||
raise EmulatorUnknown(f'Cannot stop an unknown emulator instance: {instance}')
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user