合并代码。临时上传

This commit is contained in:
2025-10-22 18:24:43 +08:00
parent a0fe54d504
commit 855a19873e
33 changed files with 1347 additions and 928 deletions

View File

@@ -1,14 +1,12 @@
import os
import signal
import subprocess
import sys
import threading
import time
from concurrent.futures import ThreadPoolExecutor, as_completed
from pathlib import Path
from typing import Dict, Optional, List
import tidevice
import usb
import wda
from tidevice import Usbmux, ConnectionType
from tidevice._device import BaseDevice
@@ -40,6 +38,7 @@ class DeviceInfo:
orphan_gc_tick = 0
while True:
online = {d.udid for d in Usbmux().device_list() if d.conn_type == ConnectionType.USB}
# 拔掉——同步
for udid in list(self._models):
if udid not in online:
@@ -123,7 +122,9 @@ class DeviceInfo:
args=(udid,)
).start()
else:
print("准备启动wda")
dev.app_start(WdaAppBundleId)
print("启动wda完成")
print("启动wda成功")
time.sleep(3)
return True
@@ -137,12 +138,12 @@ class DeviceInfo:
c.home()
size = c.window_size()
scale = c.scale
print("已获取到屏幕大小信息")
return int(size.width), int(size.height), float(scale)
except Exception as e:
print("获取设备信息遇到错误:", e)
return 0, 0, 0
...
# ---------------- 原来代码不变,只替换下面一个函数 ----------------
def _start_iproxy(self, udid: str, port: int) -> Optional[subprocess.Popen]:
try: