1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-04-02 07:14:07 +08:00

Opt: Faster local emulator connection on uiautomator2

This commit is contained in:
LmeSzinc
2022-12-04 23:31:31 +08:00
parent 2fff81ff0d
commit 85fbbcbc42

View File

@@ -248,6 +248,9 @@ class ConnectionAttr:
device = u2.connect(self.serial) device = u2.connect(self.serial)
else: else:
# Normal uiautomator2 # Normal uiautomator2
if self.serial.startswith('emulator-') or self.serial.startswith('127.0.0.1:'):
device = u2.connect_usb(self.serial)
else:
device = u2.connect(self.serial) device = u2.connect(self.serial)
# Stay alive # Stay alive