LmeSzinc / AzurLaneAutoScript

Azur Lane bot (CN/EN/JP/TW) 碧蓝航线脚本 | 无缝委托科研,全自动大世界
https://alas.azurlane.cloud
GNU General Public License v3.0
6.66k stars 785 forks source link

Alas Updater Timeout - UIAutomator Bug #1331

Closed Hummus42 closed 2 years ago

Hummus42 commented 2 years ago

Before you asking

Describe the bug

When launching Alas.exe, the Alas Updater times out due to an exception regarding UIAutomator. Has something to do with UIAutomator already being installed. Have not encountered this bug before, and have not changed anything regarding installed apks, or files recently. Alas was working fine 12 hours ago.

To Reproduce

  1. Have UIAutomator already installed
  2. Launch Alas.exe
  3. See error

Expected behavior

Usually, Alas will launch upon completion of update.

Relevant log output

==================== UIAUTOMATOR2 INIT ====================
[I 220714 12:10:44 init:156] uiautomator2 version: 2.16.7
[I 220714 12:10:44 init:356] Install minicap, minitouch
[D 220714 12:10:44 init:59] Use cached assets: C:\Users\yayah\.uiautomator2\cache\minitouch-1e3ccbf4fa\minitouch
[D 220714 12:10:44 init:238] Push to /data/local/tmp/minitouch:0755
[I 220714 12:10:44 init:360] abi:x86 not supported well, skip install minicap
[D 220714 12:10:44 init:256] apk-debug package-info: {'package_name': 'com.github.uiautomator', 'version_name': '2.3.3', 'version_code': '2003003', 'flags': ['DEBUGGABLE', 'HAS_CODE', 'ALLOW_CLEAR_USER_DATA', 'ALLOW_BACKUP'], 'first_install_time': datetime.datetime(2022, 7, 3, 20, 13, 6), 'last_update_time': datetime.datetime(2022, 7, 3, 20, 13, 6), 'signature': 'ae17cd86'}
[D 220714 12:10:44 init:257] apk-debug-test package-info: {'package_name': 'com.github.uiautomator.test', 'version_name': '', 'version_code': '', 'flags': ['DEBUGGABLE', 'HAS_CODE', 'ALLOW_CLEAR_USER_DATA', 'ALLOW_BACKUP'], 'first_install_time': datetime.datetime(2022, 7, 3, 20, 13, 11), 'last_update_time': datetime.datetime(2022, 7, 3, 20, 13, 11), 'signature': 'ae17cd86'}
[I 220714 12:10:44 init:374] Already installed com.github.uiautomator apks
[D 220714 12:10:44 init:167] Shell: ('/data/local/tmp/atx-agent', 'server', '--stop')
Traceback (most recent call last):
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\toolkit\lib\site-packages\adbutils\__init__.py", line 123, in read
    return self._read_fully(n)
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\toolkit\lib\site-packages\adbutils\__init__.py", line 131, in _read_fully
    chunk = self.conn.recv(t)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\toolkit\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\toolkit\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\deploy\installer.py", line 22, in <module>
    Installer().install()
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\deploy\installer.py", line 16, in install
    self.adb_install()
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\deploy\adb.py", line 59, in adb_install
    init.install()
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\toolkit\lib\site-packages\uiautomator2\init.py", line 377, in install
    self.shell(self.atx_agent_path, "server", "--stop")
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\toolkit\lib\site-packages\uiautomator2\init.py", line 168, in shell
    return self._device.shell(args, timeout=60)
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\toolkit\lib\site-packages\adbutils\__init__.py", line 578, in shell
    ret = self._client.shell(self._serial, cmdargs, stream=stream, timeout=timeout)
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\toolkit\lib\site-packages\adbutils\__init__.py", line 322, in shell
    return c.read_until_close()
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\toolkit\lib\site-packages\adbutils\__init__.py", line 159, in read_until_close
    chunk = self.read(4096)
  File "C:\Users\yayah\Desktop\AzurLaneAutoScript\toolkit\lib\site-packages\adbutils\__init__.py", line 125, in read
    raise AdbTimeout("adb read timeout")
adbutils.errors.AdbTimeout: adb read timeout

Screenshots

alas screenshot

Anything else?

Included screenshot of current Alas Folder.

I aplogize if this issue is already posted, I cannot read the recent issues that aren't in English.

LmeSzinc commented 2 years ago

If you are using BlueStacks or LD player or WSA, enable ADB in the settings of your emulator.

Hummus42 commented 2 years ago

adb

I appreciate the reply, ADB was already on though, maybe something else?

LmeSzinc commented 2 years ago

Do you have an app named ATX installed on your emulator?

Hummus42 commented 2 years ago

Do you have an app named ATX installed on your emulator?

  • If yes: Goto config/deploy.yaml, set InstallUiautomator2 to false
  • If no: Keep emulator running, open console.bat, try to install uiautomator2 by running python -m uiautomator2 init

Did as instructed, Alas launched appropriately. Thank you for the help.