AzurLaneAutoScript icon indicating copy to clipboard operation
AzurLaneAutoScript copied to clipboard

在未开启模拟器的情况下,Alas无法自动调起模拟器

Open AsterZ99 opened this issue 3 years ago • 2 comments

在提问之前...

  • [X] 我已经搜索了现有的 issues
  • [X] 我在提问题之前至少花费了 5 分钟来思考和准备
  • [X] 我已经阅读了 Wiki 中的 常见问题(FAQ)
  • [X] 我正在使用最新版的 Alas

描述你的问题

在未开启模拟器的情况下,Alas无法自动调起模拟器了,点击启动过几秒会直接报错,提示AttributeError: 'AzurLaneConfig' object has no attribute 'RestartEmulator_EmulatorType' 之前是可以正常使用的,突然就不行了,两台设备都是,夜神模拟器

如何复现

  1. 前往 '...'
  2. 点击 '....'
  3. 滑动到 '....'
  4. 出现问题

预期行为

No response

相关 Logs

22:43:32.459 │ DEVICE                                                                                                  
INFO     22:43:32.462 │ [AdbBinary] C:\Program Files                                                                            
         (x86)\AzurLaneAutoScript\toolkit\Lib\site-packages\adbutils\binaries\adb.exe                                           
INFO     22:43:32.476 │ [AdbClient] AdbClient(127.0.0.1, 5037)                                                                  
INFO     22:43:32.479 │ <<< DETECT DEVICE >>>                                                                                   
INFO     22:43:32.481 │ Here are the available devices, copy to Alas.Emulator.Serial to use it or set                           
         Alas.Emulator.Serial="auto"                                                                                            
INFO     22:43:32.489 │ No available devices                                                                                    
INFO     22:43:32.490 │ Here are the devices detected but unavailable                                                           
INFO     22:43:32.492 │ 127.0.0.1:62001 (offline)                                                                               
WARNING  22:43:32.493 │ Device 127.0.0.1:62001 is offline, disconnect it before connecting                                      
INFO     22:43:32.497 │ disconnected 127.0.0.1:62001                                                                            
INFO     22:43:34.554 │ cannot connect to 127.0.0.1:62001: 由于目标计算机积极拒绝,无法连接。 (10061)                           
INFO     22:43:34.557 │ cannot connect to 127.0.0.1:62001: 由于目标计算机积极拒绝,无法连接。 (10061)                           
WARNING  22:43:34.558 │ No such device exists, please restart the emulator or set a correct serial                              
INFO     22:43:34.560 │ <<< EMULATOR RESTART >>>                                                                                
ERROR    22:43:34.562 │ AttributeError: 'AzurLaneConfig' object has no attribute 'RestartEmulator_EmulatorType'                 
         ╭───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────╮
         │                                                                                                                     │
         │ C:\Program Files (x86)\AzurLaneAutoScript\module\device\emulator.py:215 in adb_connect                              │
         │                                                                                                                     │
         │   213 │   def adb_connect(self, serial):                                                                            │
         │   214 │   │   try:                                                                                                  │
         │ ❱ 215 │   │   │   return super(EmulatorManager, self).adb_connect(serial)                                           │
         │   216 │   │   except EmulatorNotRunningError:                                                                       │
         │   217 │   │   │   if self.config.RestartEmulator_ErrorRestart \                                                     │
         │                                                                                                                     │
         │ ╭──────────────────────────────── locals ────────────────────────────────╮                                          │
         │ │ __class__ = <class 'module.device.emulator.EmulatorManager'>           │                                          │
         │ │      self = <module.device.device.Device object at 0x000001C5B99A1588> │                                          │
         │ │    serial = '127.0.0.1:62001'                                          │                                          │
         │ ╰────────────────────────────────────────────────────────────────────────╯                                          │
         │ C:\Program Files (x86)\AzurLaneAutoScript\module\base\decorator.py:67 in wrapper                                    │
         │                                                                                                                     │
         │    65 │   │   │   │   │   │   continue                                                                              │
         │    66 │   │   │   │   │                                                                                             │
         │ ❱  67 │   │   │   │   │   return record['func'](self, *args, **kwargs)                                              │
         │    68 │   │   │   │                                                                                                 │
         │    69 │   │   │   │   logger.warning(f'No option fits for {name}, using the last define                             │
         │       func.')                                                                                                       │
         │                                                                                                                     │
         │ ╭─────────────────────────────────── locals ───────────────────────────────────╮                                    │
         │ │   args = ('127.0.0.1:62001',)                                                │                                    │
         │ │    cls = <class 'module.base.decorator.Config'>                              │                                    │
         │ │   flag = [True]                                                              │                                    │
         │ │   func = <function Connection.adb_connect at 0x000001C580C88DC8>             │                                    │
         │ │ kwargs = {}                                                                  │                                    │
         │ │ logger = <Logger alas (INFO)>                                                │                                    │
         │ │   name = 'adb_connect'                                                       │                                    │
         │ │ record = {                                                                   │                                    │
         │ │          │   'options': {'DEVICE_OVER_HTTP': False},                         │                                    │
         │ │          │   'func': <function Connection.adb_connect at 0x000001C580C88CA8> │                                    │
         │ │          }                                                                   │                                    │
         │ │   self = <module.device.device.Device object at 0x000001C5B99A1588>          │                                    │
         │ ╰──────────────────────────────────────────────────────────────────────────────╯                                    │
         │                                                                                                                     │
         │ C:\Program Files (x86)\AzurLaneAutoScript\module\device\connection.py:507 in adb_connect                            │
         │                                                                                                                     │
         │   505 │   │   │   │   logger.info(msg)                                                                              │
         │   506 │   │   │   │   logger.warning('No such device exists, please restart the emulator or                         │
         │       set a correct serial')                                                                                        │
         │ ❱ 507 │   │   │   │   raise EmulatorNotRunningError                                                                 │
         │   508 │   │                                                                                                         │
         │   509 │   │   # Failed to connect                                                                                   │
         │                                                                                                                     │
         │ ╭───────────────────────────────────────── locals ─────────────────────────────────────────╮                        │
         │ │      _ = 0                                                                               │                        │
         │ │ device = AdbDevice(127.0.0.1:62001, offline)                                             │                        │
         │ │    msg = 'cannot connect to 127.0.0.1:62001: 由于目标计算机积极拒绝,无法连接。 (10061)' │                        │
         │ │   self = <module.device.device.Device object at 0x000001C5B99A1588>                      │                        │
         │ │ serial = '127.0.0.1:62001'                                                               │                        │
         │ ╰──────────────────────────────────────────────────────────────────────────────────────────╯                        │
         ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
         EmulatorNotRunningError                                                                                                
                                                                                                                                
         During handling of the above exception, another exception occurred:                                                    
                                                                                                                                
         ╭───────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────╮
         │                                                                                                                     │
         │ C:\Program Files (x86)\AzurLaneAutoScript\alas.py:41 in device                                                      │
         │                                                                                                                     │
         │    39 │   │   try:                                                                                                  │
         │    40 │   │   │   from module.device.device import Device                                                           │
         │ ❱  41 │   │   │   device = Device(config=self.config)                                                               │
         │    42 │   │   │   return device                                                                                     │
         │    43 │   │   except RequestHumanTakeover:                                                                          │
         │                                                                                                                     │
         │ ╭────────────────────────────────────────────── locals ──────────────────────────────────────────────╮              │
         │ │ Device = <class 'module.device.device.Device'>                                                     │              │
         │ │      e = AttributeError("'AzurLaneConfig' object has no attribute 'RestartEmulator_EmulatorType'") │              │
         │ │   self = <alas.AzurLaneAutoScript object at 0x000001C5B7F72E88>                                    │              │
         │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯              │
         │ C:\Program Files (x86)\AzurLaneAutoScript\module\device\device.py:31 in __init__                                    │
         │                                                                                                                     │
         │    29 │                                                                                                             │
         │    30 │   def __init__(self, *args, **kwargs):                                                                      │
         │ ❱  31 │   │   super().__init__(*args, **kwargs)                                                                     │
         │    32 │   │   self.screenshot_interval_set()                                                                        │
         │    33                                                                                                               │
         │                                                                                                                     │
         │ ╭────────────────────────────────────────── locals ──────────────────────────────────────────╮                      │
         │ │ __class__ = <class 'module.device.device.Device'>                                          │                      │
         │ │      args = ()                                                                             │                      │
         │ │    kwargs = {'config': <module.config.config.AzurLaneConfig object at 0x000001C5B7F72108>} │                      │
         │ │      self = <module.device.device.Device object at 0x000001C5B99A1588>                     │                      │
         │ ╰────────────────────────────────────────────────────────────────────────────────────────────╯                      │
         │                                                                                                                     │
         │ C:\Program Files (x86)\AzurLaneAutoScript\module\device\connection.py:101 in __init__                               │
         │                                                                                                                     │
         │    99 │   │                                                                                                         │
         │   100 │   │   # Connect                                                                                             │
         │ ❱ 101 │   │   self.adb_connect(self.serial)                                                                         │
         │   102 │   │   logger.attr('AdbDevice', self.adb)                                                                    │
         │   103                                                                                                               │
         │                                                                                                                     │
         │ ╭──────────────────────────────────── locals ────────────────────────────────────╮                                  │
         │ │ __class__ = <class 'module.device.connection.Connection'>                      │                                  │
         │ │    config = <module.config.config.AzurLaneConfig object at 0x000001C5B7F72108> │                                  │
         │ │      self = <module.device.device.Device object at 0x000001C5B99A1588>         │                                  │
         │ ╰────────────────────────────────────────────────────────────────────────────────╯                                  │
         │                                                                                                                     │
         │ C:\Program Files (x86)\AzurLaneAutoScript\module\device\emulator.py:218 in adb_connect                              │
         │                                                                                                                     │
         │   216 │   │   except EmulatorNotRunningError:                                                                       │
         │   217 │   │   │   if self.config.RestartEmulator_ErrorRestart \                                                     │
         │ ❱ 218 │   │   │   │   │   and self.emulator_restart():                                                              │
         │   219 │   │   │   │   return True                                                                                   │
         │   220 │   │   │   raise RequestHumanTakeover                                                                        │
         │                                                                                                                     │
         │ ╭──────────────────────────────── locals ────────────────────────────────╮                                          │
         │ │ __class__ = <class 'module.device.emulator.EmulatorManager'>           │                                          │
         │ │      self = <module.device.device.Device object at 0x000001C5B99A1588> │                                          │
         │ │    serial = '127.0.0.1:62001'                                          │                                          │
         │ ╰────────────────────────────────────────────────────────────────────────╯                                          │
         │                                                                                                                     │
         │ C:\Program Files (x86)\AzurLaneAutoScript\module\device\emulator.py:315 in emulator_restart                         │
         │                                                                                                                     │
         │   313 │   │                                                                                                         │
         │   314 │   │   logger.hr('Emulator restart')                                                                         │
         │ ❱ 315 │   │   if self.config.RestartEmulator_EmulatorType == 'auto':                                                │
         │   316 │   │   │   emulator, multi_id = self.detect_emulator(serial)                                                 │
         │   317 │   │   else:                                                                                                 │
         │                                                                                                                     │
         │ ╭────────────────────────────── locals ───────────────────────────────╮                                             │
         │ │      _ = None                                                       │                                             │
         │ │   self = <module.device.device.Device object at 0x000001C5B99A1588> │                                             │
         │ │ serial = '127.0.0.1:62001'                                          │                                             │
         │ ╰─────────────────────────────────────────────────────────────────────╯                                             │
         ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
         AttributeError: 'AzurLaneConfig' object has no attribute 'RestartEmulator_EmulatorType'

截图

No response

还有别的吗?

No response

AsterZ99 avatar Jan 06 '23 14:01 AsterZ99

看#2068 里开发者的回复,最近好像是在重写相关的代码

LostMyMind avatar Jan 07 '23 02:01 LostMyMind

看#2068 里开发者的回复,最近好像是在重写相关的代码

感谢

AsterZ99 avatar Jan 07 '23 12:01 AsterZ99