修复bug
This commit is contained in:
51
.idea/workspace.xml
generated
51
.idea/workspace.xml
generated
@@ -5,10 +5,9 @@
|
|||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="eceeff5e-51c1-459c-a911-d21ec090a423" name="Changes" comment="ai 开始测试">
|
<list default="true" id="eceeff5e-51c1-459c-a911-d21ec090a423" name="Changes" comment="ai 开始测试">
|
||||||
<change afterPath="$PROJECT_DIR$/resources/iproxy/tidevice.exe" afterDir="false" />
|
|
||||||
<change afterPath="$PROJECT_DIR$/tidevice_entry.py" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/Entity/Variables.py" beforeDir="false" afterPath="$PROJECT_DIR$/Entity/Variables.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/Module/DeviceInfo.py" beforeDir="false" afterPath="$PROJECT_DIR$/Module/DeviceInfo.py" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Module/Main.py" beforeDir="false" afterPath="$PROJECT_DIR$/Module/Main.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/build.bat" beforeDir="false" afterPath="$PROJECT_DIR$/build.bat" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/build.bat" beforeDir="false" afterPath="$PROJECT_DIR$/build.bat" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
@@ -49,27 +48,27 @@
|
|||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
<component name="PropertiesComponent">{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"ASKED_ADD_EXTERNAL_FILES": "true",
|
"ASKED_ADD_EXTERNAL_FILES": "true",
|
||||||
"Python.123.executor": "Run",
|
"Python.123.executor": "Run",
|
||||||
"Python.Main.executor": "Run",
|
"Python.Main.executor": "Run",
|
||||||
"Python.tidevice_entry.executor": "Run",
|
"Python.tidevice_entry.executor": "Run",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||||
"git-widget-placeholder": "main",
|
"git-widget-placeholder": "main",
|
||||||
"javascript.nodejs.core.library.configured.version": "22.18.0",
|
"javascript.nodejs.core.library.configured.version": "22.18.0",
|
||||||
"javascript.nodejs.core.library.typings.version": "22.18.0",
|
"javascript.nodejs.core.library.typings.version": "22.18.0",
|
||||||
"last_opened_file_path": "F:/company code/AI item/20250820/iOSAI",
|
"last_opened_file_path": "F:/company code/AI item/20250820/iOSAI",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.detected.package.tslint": "true",
|
"node.js.detected.package.tslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
"node.js.selected.package.tslint": "(autodetect)",
|
"node.js.selected.package.tslint": "(autodetect)",
|
||||||
"nodejs_package_manager_path": "npm",
|
"nodejs_package_manager_path": "npm",
|
||||||
"settings.editor.selected.configurable": "com.gitee.ui.GiteeSettingsConfigurable",
|
"settings.editor.selected.configurable": "com.gitee.ui.GiteeSettingsConfigurable",
|
||||||
"vue.rearranger.settings.migration": "true"
|
"vue.rearranger.settings.migration": "true"
|
||||||
}
|
}
|
||||||
}]]></component>
|
}</component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
<key name="MoveFile.RECENT_KEYS">
|
||||||
<recent name="E:\Code\python\iOSAI\resources" />
|
<recent name="E:\Code\python\iOSAI\resources" />
|
||||||
@@ -151,6 +150,10 @@
|
|||||||
<workItem from="1756817404737" duration="95000" />
|
<workItem from="1756817404737" duration="95000" />
|
||||||
<workItem from="1756876974097" duration="8214000" />
|
<workItem from="1756876974097" duration="8214000" />
|
||||||
<workItem from="1756886673655" duration="1733000" />
|
<workItem from="1756886673655" duration="1733000" />
|
||||||
|
<workItem from="1756902640971" duration="40000" />
|
||||||
|
<workItem from="1756907370591" duration="18000" />
|
||||||
|
<workItem from="1756967617322" duration="1877000" />
|
||||||
|
<workItem from="1756971523653" duration="11776000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="ai 开始测试">
|
<task id="LOCAL-00001" summary="ai 开始测试">
|
||||||
<option name="closed" value="true" />
|
<option name="closed" value="true" />
|
||||||
@@ -175,7 +178,7 @@
|
|||||||
<option name="LAST_COMMIT_MESSAGE" value="ai 开始测试" />
|
<option name="LAST_COMMIT_MESSAGE" value="ai 开始测试" />
|
||||||
</component>
|
</component>
|
||||||
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
||||||
<SUITE FILE_PATH="coverage/iOSAI$Main.coverage" NAME="Main Coverage Results" MODIFIED="1756877405122" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
|
<SUITE FILE_PATH="coverage/iOSAI$Main.coverage" NAME="Main Coverage Results" MODIFIED="1756989981909" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
|
||||||
<SUITE FILE_PATH="coverage/iOSAI$mac_wda_agent.coverage" NAME="mac_wda_agent Coverage Results" MODIFIED="1756473148639" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/script" />
|
<SUITE FILE_PATH="coverage/iOSAI$mac_wda_agent.coverage" NAME="mac_wda_agent Coverage Results" MODIFIED="1756473148639" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/script" />
|
||||||
<SUITE FILE_PATH="coverage/iOSAI$tidevice_entry.coverage" NAME="tidevice_entry Coverage Results" MODIFIED="1756886706033" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
<SUITE FILE_PATH="coverage/iOSAI$tidevice_entry.coverage" NAME="tidevice_entry Coverage Results" MODIFIED="1756886706033" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||||
<SUITE FILE_PATH="coverage/iOSAI$123.coverage" NAME="123 覆盖结果" MODIFIED="1756300694280" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" />
|
<SUITE FILE_PATH="coverage/iOSAI$123.coverage" NAME="123 覆盖结果" MODIFIED="1756300694280" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="false" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" />
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import subprocess
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Dict, Optional
|
from typing import List, Dict, Optional
|
||||||
|
|
||||||
from tidevice import Usbmux
|
from tidevice import Usbmux, ConnectionType
|
||||||
from Entity.DeviceModel import DeviceModel
|
from Entity.DeviceModel import DeviceModel
|
||||||
from Entity.Variables import WdaAppBundleId
|
from Entity.Variables import WdaAppBundleId
|
||||||
from Module.FlaskSubprocessManager import FlaskSubprocessManager
|
from Module.FlaskSubprocessManager import FlaskSubprocessManager
|
||||||
@@ -110,13 +110,15 @@ class Deviceinfo(object):
|
|||||||
continue
|
continue
|
||||||
# 新接入设备
|
# 新接入设备
|
||||||
for device in lists:
|
for device in lists:
|
||||||
if (device not in self.deviceArray) and (len(self.deviceArray) < self.maxDeviceCount):
|
# usb设备,并且为新设备。并且大于总限制数量
|
||||||
|
if device.conn_type == ConnectionType.USB and (device not in self.deviceArray) and (len(self.deviceArray) < self.maxDeviceCount):
|
||||||
self.screenProxy += 1
|
self.screenProxy += 1
|
||||||
try:
|
try:
|
||||||
self.connectDevice(device.udid)
|
self.connectDevice(device.udid)
|
||||||
self.deviceArray.append(device)
|
self.deviceArray.append(device)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LogManager.error(f"连接设备失败 {device.udid}: {e}", device.udid)
|
LogManager.error(f"连接设备失败 {device.udid}: {e}", device.udid)
|
||||||
|
|
||||||
# 拔出设备处理
|
# 拔出设备处理
|
||||||
self._removeDisconnected(lists)
|
self._removeDisconnected(lists)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
@@ -126,9 +128,9 @@ class Deviceinfo(object):
|
|||||||
# ----------------------------
|
# ----------------------------
|
||||||
def connectDevice(self, identifier: str):
|
def connectDevice(self, identifier: str):
|
||||||
# 1) 连接 WDA(USBClient -> 设备 8100)
|
# 1) 连接 WDA(USBClient -> 设备 8100)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
d = wda.USBClient(identifier, 8100)
|
d = wda.USBClient(identifier, 8100)
|
||||||
|
|
||||||
LogManager.info("启动 WDA 成功", identifier)
|
LogManager.info("启动 WDA 成功", identifier)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
LogManager.error(f"启动 WDA 失败,请检查手机是否已信任、WDA 是否正常。错误: {e}", identifier)
|
LogManager.error(f"启动 WDA 失败,请检查手机是否已信任、WDA 是否正常。错误: {e}", identifier)
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from Module.FlaskSubprocessManager import FlaskSubprocessManager
|
|||||||
from Utils.DevDiskImageDeployer import DevDiskImageDeployer
|
from Utils.DevDiskImageDeployer import DevDiskImageDeployer
|
||||||
from Utils.LogManager import LogManager
|
from Utils.LogManager import LogManager
|
||||||
|
|
||||||
|
|
||||||
# 确定 exe 或 py 文件所在目录
|
# 确定 exe 或 py 文件所在目录
|
||||||
BASE = Path(getattr(sys, 'frozen', False) and sys.executable or __file__).resolve().parent
|
BASE = Path(getattr(sys, 'frozen', False) and sys.executable or __file__).resolve().parent
|
||||||
LOG_DIR = BASE / "log"
|
LOG_DIR = BASE / "log"
|
||||||
@@ -25,8 +26,10 @@ if "--role=flask" in sys.argv:
|
|||||||
_run_flask_role()
|
_run_flask_role()
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
# 项目入口
|
# 项目入口
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
# 添加iOS开发包到电脑上
|
# 添加iOS开发包到电脑上
|
||||||
deployer = DevDiskImageDeployer(verbose=True)
|
deployer = DevDiskImageDeployer(verbose=True)
|
||||||
deployer.deploy_all()
|
deployer.deploy_all()
|
||||||
|
|||||||
11
build.bat
11
build.bat
@@ -1,17 +1,11 @@
|
|||||||
@echo off
|
python -m nuitka Module/Main.py ^
|
||||||
python -m nuitka Module\Main.py ^
|
|
||||||
--standalone ^
|
--standalone ^
|
||||||
--msvc=latest ^
|
--msvc=latest ^
|
||||||
--windows-console-mode=disable ^
|
--windows-console-mode=disable ^
|
||||||
--remove-output ^
|
--remove-output ^
|
||||||
--output-dir=out ^
|
--output-dir=out ^
|
||||||
--output-filename=IOSAI ^
|
--output-filename=IOSAI ^
|
||||||
--include-package=Module,Utils,Entity,script,tidevice ^
|
--include-package=Module,Utils,Entity,script ^
|
||||||
--include-module=tidevice.__main__ ^
|
|
||||||
--include-module=tidevice._proto ^
|
|
||||||
--include-module=tidevice._instruments ^
|
|
||||||
--include-module=tidevice._usbmux ^
|
|
||||||
--include-module=tidevice._wdaproxy ^
|
|
||||||
--include-module=flask ^
|
--include-module=flask ^
|
||||||
--include-module=flask_cors ^
|
--include-module=flask_cors ^
|
||||||
--include-module=jinja2 ^
|
--include-module=jinja2 ^
|
||||||
@@ -28,4 +22,3 @@ python -m nuitka Module\Main.py ^
|
|||||||
--include-data-dir="E:/Code/python/iOSAI/resources=resources" ^
|
--include-data-dir="E:/Code/python/iOSAI/resources=resources" ^
|
||||||
--include-data-files="E:/Code/python/iOSAI/resources/iproxy/*=resources/iproxy/" ^
|
--include-data-files="E:/Code/python/iOSAI/resources/iproxy/*=resources/iproxy/" ^
|
||||||
--windows-icon-from-ico=resources/icon.ico
|
--windows-icon-from-ico=resources/icon.ico
|
||||||
pause
|
|
||||||
Reference in New Issue
Block a user