mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 09:48:20 +08:00
Fix: [ALAS] Trying to handle AdbError: unknown host service
(cherry picked from commit 59ad8bd6fcd4b63ab9a557b1bd11aa92fb071e13)
This commit is contained in:
@@ -206,12 +206,6 @@ def handle_adb_error(e):
|
||||
# Raised by uiautomator2 when current adb service is killed by another version of adb service.
|
||||
logger.error(e)
|
||||
return True
|
||||
elif 'unknown host service' in text:
|
||||
# AdbError(unknown host service)
|
||||
# Another version of ADB service started, current ADB service has been killed.
|
||||
# Usually because user opened a Chinese emulator, which uses ADB from the Stone Age.
|
||||
logger.error(e)
|
||||
return True
|
||||
else:
|
||||
# AdbError()
|
||||
logger.exception(e)
|
||||
@@ -223,6 +217,25 @@ def handle_adb_error(e):
|
||||
return False
|
||||
|
||||
|
||||
def handle_unknown_host_service(e):
|
||||
"""
|
||||
Args:
|
||||
e (Exception):
|
||||
|
||||
Returns:
|
||||
bool: If should retry
|
||||
"""
|
||||
text = str(e)
|
||||
if 'unknown host service' in text:
|
||||
# AdbError(unknown host service)
|
||||
# Another version of ADB service started, current ADB service has been killed.
|
||||
# Usually because user opened a Chinese emulator, which uses ADB from the Stone Age.
|
||||
logger.error(e)
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
|
||||
def get_serial_pair(serial):
|
||||
"""
|
||||
Args:
|
||||
|
||||
Reference in New Issue
Block a user