diff --git a/module/device/device.py b/module/device/device.py index ad97d15..2ca2d36 100644 --- a/module/device/device.py +++ b/module/device/device.py @@ -70,11 +70,14 @@ class Device(Screenshot, Control, AppControl): stuck_timer = Timer(60, count=60).start() def __init__(self, *args, **kwargs): - for _ in range(2): + for trial in range(4): try: super().__init__(*args, **kwargs) break except EmulatorNotRunningError: + if trial >= 3: + logger.critical('Failed to start emulator after 3 trial') + raise RequestHumanTakeover # Try to start emulator if self.emulator_instance is not None: self.emulator_start() @@ -83,7 +86,7 @@ class Device(Screenshot, Control, AppControl): f'No emulator with serial "{self.config.Emulator_Serial}" found, ' f'please set a correct serial' ) - raise + raise RequestHumanTakeover # Auto-fill emulator info if IS_WINDOWS and self.config.EmulatorInfo_Emulator == 'auto': diff --git a/module/device/platform/platform_windows.py b/module/device/platform/platform_windows.py index 6db4eb6..b0cb83b 100644 --- a/module/device/platform/platform_windows.py +++ b/module/device/platform/platform_windows.py @@ -234,7 +234,7 @@ class PlatformWindows(PlatformBase, EmulatorManager): logger.info(f'Found azurlane packages: {m}') interval = Timer(0.5).start() - timeout = Timer(300).start() + timeout = Timer(180).start() new_window = 0 while 1: interval.wait()