ai 开始测试
This commit is contained in:
2
.idea/iOSAI.iml
generated
2
.idea/iOSAI.iml
generated
@@ -2,7 +2,7 @@
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.12 (IOS-AI)" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.12" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,5 +3,5 @@
|
||||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.12" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (IOS-AI)" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
63
.idea/workspace.xml
generated
63
.idea/workspace.xml
generated
@@ -5,11 +5,7 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="eceeff5e-51c1-459c-a911-d21ec090a423" name="Changes" comment="ai 开始测试">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Utils/ControlUtils.py" beforeDir="false" afterPath="$PROJECT_DIR$/Utils/ControlUtils.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/03cb0d61638ab919e9c9c5e016b969ff40925b0c/bgv.png" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/resources/833c034d29ee6b79e1dfd88dc1d454f3da1e8a3d/bgv.png" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/script/ScriptManager.py" beforeDir="false" afterPath="$PROJECT_DIR$/script/ScriptManager.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Module/Main.py" beforeDir="false" afterPath="$PROJECT_DIR$/Module/Main.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -49,25 +45,26 @@
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"Python.123.executor": "Run",
|
||||
"Python.Main.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"javascript.nodejs.core.library.configured.version": "20.17.0",
|
||||
"javascript.nodejs.core.library.typings.version": "20.17.58",
|
||||
"last_opened_file_path": "F:/company code/AI item/20250820/iOSAI",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "com.gitee.ui.GiteeSettingsConfigurable",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"ASKED_ADD_EXTERNAL_FILES": "true",
|
||||
"Python.123.executor": "Run",
|
||||
"Python.Main.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"javascript.nodejs.core.library.configured.version": "22.18.0",
|
||||
"javascript.nodejs.core.library.typings.version": "22.18.0",
|
||||
"last_opened_file_path": "F:/company code/AI item/20250820/iOSAI",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "com.gitee.ui.GiteeSettingsConfigurable",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}</component>
|
||||
}]]></component>
|
||||
<component name="RecentsManager">
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="E:\Code\python\iOSAI\resources" />
|
||||
@@ -165,8 +162,9 @@
|
||||
<workItem from="1756101135190" duration="18679000" />
|
||||
<workItem from="1756124879602" duration="580000" />
|
||||
<workItem from="1756184656258" duration="24292000" />
|
||||
<workItem from="1756271781908" duration="27411000" />
|
||||
<workItem from="1756357505672" duration="11939000" />
|
||||
<workItem from="1756271781908" duration="26153000" />
|
||||
<workItem from="1756303414374" duration="1018000" />
|
||||
<workItem from="1756361418986" duration="5886000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="ai 开始测试">
|
||||
<option name="closed" value="true" />
|
||||
@@ -176,15 +174,7 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1756303135240</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00002" summary="ai 开始测试">
|
||||
<option name="closed" value="true" />
|
||||
<created>1756303233850</created>
|
||||
<option name="number" value="00002" />
|
||||
<option name="presentableId" value="LOCAL-00002" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1756303233850</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="3" />
|
||||
<option name="localTasksCounter" value="2" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
@@ -194,11 +184,12 @@
|
||||
<option featureType="com.intellij.fileTypeFactory" implementationName="*.bat" />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||
<MESSAGE value="ai 开始测试" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="ai 开始测试" />
|
||||
</component>
|
||||
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
||||
<SUITE FILE_PATH="coverage/iOSAI$Main.coverage" NAME="Main 覆盖结果" MODIFIED="1756368721406" 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$123.coverage" NAME="123 覆盖结果" MODIFIED="1756365089648" 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$Main.coverage" NAME="Main Coverage Results" MODIFIED="1756366476180" 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$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" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,10 +1,9 @@
|
||||
import threading
|
||||
from typing import Dict, Any
|
||||
|
||||
from Entity.AnchorModel import AnchorModel
|
||||
|
||||
# wda apple bundle id
|
||||
WdaAppBundleId = "com.yoloAgant.wda.xctrunner"
|
||||
WdaAppBundleId = "com.yoloAgent.wda.xctrunner"
|
||||
# 全局主播列表
|
||||
anchorList: list[AnchorModel] = []
|
||||
# 线程锁
|
||||
|
||||
@@ -21,7 +21,6 @@ class Deviceinfo(object):
|
||||
self.deviceIndex = 0
|
||||
# 投屏端口(本地映射端口起始值,会递增)
|
||||
self.screenProxy = 9110
|
||||
|
||||
# 记录 iproxy Popen 进程:[{ "id": udid, "target": Popen }, ...]
|
||||
self.pidList: List[Dict] = []
|
||||
# 当前已连接的设备(tidevice 的 Device 对象列表)
|
||||
@@ -55,9 +54,9 @@ class Deviceinfo(object):
|
||||
cwd=str(self.iproxy_dir),
|
||||
shell=False,
|
||||
text=True,
|
||||
creationflags=self._creationflags,
|
||||
encoding="utf-8",
|
||||
bufsize=1,
|
||||
creationflags=self._creationflags,
|
||||
)
|
||||
|
||||
# 3) 准备一个“启动器”(闭包):仅接受 (udid, local_port, remote_port) 参数
|
||||
|
||||
@@ -4,6 +4,7 @@ from pathlib import Path
|
||||
|
||||
from Module.DeviceInfo import Deviceinfo
|
||||
from Module.FlaskSubprocessManager import FlaskSubprocessManager
|
||||
from Utils.DevDiskImageDeployer import DevDiskImageDeployer
|
||||
from Utils.LogManager import LogManager
|
||||
|
||||
# 确定 exe 或 py 文件所在目录
|
||||
@@ -26,8 +27,9 @@ if "--role=flask" in sys.argv:
|
||||
|
||||
# 项目入口
|
||||
if __name__ == "__main__":
|
||||
# 清空日志等
|
||||
# LogManager.clearLogs()
|
||||
# 添加iOS开发包到电脑上
|
||||
deployer = DevDiskImageDeployer(verbose=True)
|
||||
deployer.deploy_all()
|
||||
|
||||
# 启动 Flask 子进程
|
||||
manager = FlaskSubprocessManager.get_instance()
|
||||
|
||||
BIN
SupportFiles/15.0/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/15.0/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
1
SupportFiles/15.0/DeveloperDiskImage.dmg.signature
Normal file
1
SupportFiles/15.0/DeveloperDiskImage.dmg.signature
Normal file
@@ -0,0 +1 @@
|
||||
<19>8!<21>=Y<01>
|
||||
BIN
SupportFiles/15.1/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/15.1/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
2
SupportFiles/15.1/DeveloperDiskImage.dmg.signature
Normal file
2
SupportFiles/15.1/DeveloperDiskImage.dmg.signature
Normal file
@@ -0,0 +1,2 @@
|
||||
<EFBFBD>j#
|
||||
<EFBFBD>8Q<EFBFBD>_<EFBFBD>jl<EFBFBD><EFBFBD>~<03><><EFBFBD>y<EFBFBD><79>=<3D>Xć<58><C487><EFBFBD><EFBFBD>wۥ_<>{,<08><><EFBFBD><EFBFBD><EFBFBD>ϋL<CF8B>Rm<52>0<EFBFBD>^<5E><>W<EFBFBD>SMF{[^<5E>f<><66><EFBFBD><EFBFBD>]̧<><CCA7><EFBFBD>ʼ<><CABC>辮($⊬Ei<18>{<7B><>Wq4e<>-ɿ
|
||||
BIN
SupportFiles/15.2/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/15.2/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
2
SupportFiles/15.2/DeveloperDiskImage.dmg.signature
Normal file
2
SupportFiles/15.2/DeveloperDiskImage.dmg.signature
Normal file
@@ -0,0 +1,2 @@
|
||||
<EFBFBD>j#
|
||||
<EFBFBD>8Q<EFBFBD>_<EFBFBD>jl<EFBFBD><EFBFBD>~<03><><EFBFBD>y<EFBFBD><79>=<3D>Xć<58><C487><EFBFBD><EFBFBD>wۥ_<>{,<08><><EFBFBD><EFBFBD><EFBFBD>ϋL<CF8B>Rm<52>0<EFBFBD>^<5E><>W<EFBFBD>SMF{[^<5E>f<><66><EFBFBD><EFBFBD>]̧<><CCA7><EFBFBD>ʼ<><CABC>辮($⊬Ei<18>{<7B><>Wq4e<>-ɿ
|
||||
BIN
SupportFiles/15.3.1/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/15.3.1/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
BIN
SupportFiles/15.3.1/DeveloperDiskImage.dmg.signature
Normal file
BIN
SupportFiles/15.3.1/DeveloperDiskImage.dmg.signature
Normal file
Binary file not shown.
BIN
SupportFiles/15.3/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/15.3/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
BIN
SupportFiles/15.3/DeveloperDiskImage.dmg.signature
Normal file
BIN
SupportFiles/15.3/DeveloperDiskImage.dmg.signature
Normal file
Binary file not shown.
BIN
SupportFiles/15.4/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/15.4/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
BIN
SupportFiles/15.4/DeveloperDiskImage.dmg.signature
Normal file
BIN
SupportFiles/15.4/DeveloperDiskImage.dmg.signature
Normal file
Binary file not shown.
BIN
SupportFiles/15.5/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/15.5/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
BIN
SupportFiles/15.5/DeveloperDiskImage.dmg.signature
Normal file
BIN
SupportFiles/15.5/DeveloperDiskImage.dmg.signature
Normal file
Binary file not shown.
BIN
SupportFiles/15.6.1/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/15.6.1/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
BIN
SupportFiles/15.6.1/DeveloperDiskImage.dmg.signature
Normal file
BIN
SupportFiles/15.6.1/DeveloperDiskImage.dmg.signature
Normal file
Binary file not shown.
BIN
SupportFiles/15.6/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/15.6/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
BIN
SupportFiles/15.6/DeveloperDiskImage.dmg.signature
Normal file
BIN
SupportFiles/15.6/DeveloperDiskImage.dmg.signature
Normal file
Binary file not shown.
BIN
SupportFiles/15.7/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/15.7/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
2
SupportFiles/15.7/DeveloperDiskImage.dmg.signature
Normal file
2
SupportFiles/15.7/DeveloperDiskImage.dmg.signature
Normal file
@@ -0,0 +1,2 @@
|
||||
<EFBFBD><1B><><EFBFBD>i<>{<7B><><EFBFBD><EFBFBD>l<EFBFBD>̞d+3B<1B>s
|
||||
<EFBFBD><EFBFBD><EFBFBD>NMÅ<EFBFBD><EFBFBD><01><>|<7C><06><><1E>)<11><>!<21><><EFBFBD>%<25><>o<EFBFBD>O
|
||||
BIN
SupportFiles/15.8/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/15.8/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
2
SupportFiles/15.8/DeveloperDiskImage.dmg.signature
Normal file
2
SupportFiles/15.8/DeveloperDiskImage.dmg.signature
Normal file
@@ -0,0 +1,2 @@
|
||||
<EFBFBD><1B><><EFBFBD>i<>{<7B><><EFBFBD><EFBFBD>l<EFBFBD>̞d+3B<1B>s
|
||||
<EFBFBD><EFBFBD><EFBFBD>NMÅ<EFBFBD><EFBFBD><01><>|<7C><06><><1E>)<11><>!<21><><EFBFBD>%<25><>o<EFBFBD>O
|
||||
BIN
SupportFiles/16.0/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/16.0/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
BIN
SupportFiles/16.0/DeveloperDiskImage.dmg.signature
Normal file
BIN
SupportFiles/16.0/DeveloperDiskImage.dmg.signature
Normal file
Binary file not shown.
BIN
SupportFiles/16.1/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/16.1/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
BIN
SupportFiles/16.1/DeveloperDiskImage.dmg.signature
Normal file
BIN
SupportFiles/16.1/DeveloperDiskImage.dmg.signature
Normal file
Binary file not shown.
BIN
SupportFiles/16.2/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/16.2/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
2
SupportFiles/16.2/DeveloperDiskImage.dmg.signature
Normal file
2
SupportFiles/16.2/DeveloperDiskImage.dmg.signature
Normal file
@@ -0,0 +1,2 @@
|
||||
e#|?<3F><><EFBFBD><EFBFBD>WO<16>"m<>lW<6C>0 qf<71>=N<>`<60><>x<EFBFBD><78><03><>`<60>q<EFBFBD><71>y<EFBFBD><04><><EFBFBD><EFBFBD>L<EFBFBD><4C><EFBFBD>f<EFBFBD>@<40><><EFBFBD>^<5E><04><>tg<74><67><EFBFBD>ka1D<31>I'<27><><EFBFBD><01>
|
||||
j<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2@<40><>a<12><>P\<5C>y~Ru<52>r2¤<1D>Q<EFBFBD><01><诰<><E8AFB0>4<EFBFBD><34><EFBFBD><EFBFBD>
|
||||
BIN
SupportFiles/16.3.1/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/16.3.1/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
2
SupportFiles/16.3.1/DeveloperDiskImage.dmg.signature
Normal file
2
SupportFiles/16.3.1/DeveloperDiskImage.dmg.signature
Normal file
@@ -0,0 +1,2 @@
|
||||
e#|?<3F><><EFBFBD><EFBFBD>WO<16>"m<>lW<6C>0 qf<71>=N<>`<60><>x<EFBFBD><78><03><>`<60>q<EFBFBD><71>y<EFBFBD><04><><EFBFBD><EFBFBD>L<EFBFBD><4C><EFBFBD>f<EFBFBD>@<40><><EFBFBD>^<5E><04><>tg<74><67><EFBFBD>ka1D<31>I'<27><><EFBFBD><01>
|
||||
j<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2@<40><>a<12><>P\<5C>y~Ru<52>r2¤<1D>Q<EFBFBD><01><诰<><E8AFB0>4<EFBFBD><34><EFBFBD><EFBFBD>
|
||||
BIN
SupportFiles/16.3/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/16.3/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
2
SupportFiles/16.3/DeveloperDiskImage.dmg.signature
Normal file
2
SupportFiles/16.3/DeveloperDiskImage.dmg.signature
Normal file
@@ -0,0 +1,2 @@
|
||||
e#|?<3F><><EFBFBD><EFBFBD>WO<16>"m<>lW<6C>0 qf<71>=N<>`<60><>x<EFBFBD><78><03><>`<60>q<EFBFBD><71>y<EFBFBD><04><><EFBFBD><EFBFBD>L<EFBFBD><4C><EFBFBD>f<EFBFBD>@<40><><EFBFBD>^<5E><04><>tg<74><67><EFBFBD>ka1D<31>I'<27><><EFBFBD><01>
|
||||
j<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2@<40><>a<12><>P\<5C>y~Ru<52>r2¤<1D>Q<EFBFBD><01><诰<><E8AFB0>4<EFBFBD><34><EFBFBD><EFBFBD>
|
||||
BIN
SupportFiles/16.4/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/16.4/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
1
SupportFiles/16.4/DeveloperDiskImage.dmg.signature
Normal file
1
SupportFiles/16.4/DeveloperDiskImage.dmg.signature
Normal file
@@ -0,0 +1 @@
|
||||
+<19><><EFBFBD><EFBFBD><EFBFBD>F<<3C><><EFBFBD>n<EFBFBD>И<<|<7C>٠3#
|
||||
BIN
SupportFiles/16.5/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/16.5/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
1
SupportFiles/16.5/DeveloperDiskImage.dmg.signature
Normal file
1
SupportFiles/16.5/DeveloperDiskImage.dmg.signature
Normal file
@@ -0,0 +1 @@
|
||||
+<19><><EFBFBD><EFBFBD><EFBFBD>F<<3C><><EFBFBD>n<EFBFBD>И<<|<7C>٠3#
|
||||
BIN
SupportFiles/16.6/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/16.6/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
1
SupportFiles/16.6/DeveloperDiskImage.dmg.signature
Normal file
1
SupportFiles/16.6/DeveloperDiskImage.dmg.signature
Normal file
@@ -0,0 +1 @@
|
||||
7e<37>k$#5@<02>mj<04><><EFBFBD><EFBFBD>P:/<2F>r<><72>̮9R<39><52><EFBFBD>)<29><>z<EFBFBD>*c4<63><03><><EFBFBD>߯<EFBFBD><DFAF><EFBFBD><EFBFBD><EFBFBD> <20><>u&<26><>7Q{FzӃ<7A><D383>[Qs<><73><EFBFBD><17>ZۊHnIֵ1<D6B5>kHVMP<4D>O".<2E><><7F><15><<3C><><EFBFBD>6?<3F>I<EFBFBD>&|<7C>0
|
||||
BIN
SupportFiles/16.7/DeveloperDiskImage.dmg
Normal file
BIN
SupportFiles/16.7/DeveloperDiskImage.dmg
Normal file
Binary file not shown.
1
SupportFiles/16.7/DeveloperDiskImage.dmg.signature
Normal file
1
SupportFiles/16.7/DeveloperDiskImage.dmg.signature
Normal file
@@ -0,0 +1 @@
|
||||
7e<37>k$#5@<02>mj<04><><EFBFBD><EFBFBD>P:/<2F>r<><72>̮9R<39><52><EFBFBD>)<29><>z<EFBFBD>*c4<63><03><><EFBFBD>߯<EFBFBD><DFAF><EFBFBD><EFBFBD><EFBFBD> <20><>u&<26><>7Q{FzӃ<7A><D383>[Qs<><73><EFBFBD><17>ZۊHnIֵ1<D6B5>kHVMP<4D>O".<2E><><7F><15><<3C><><EFBFBD>6?<3F>I<EFBFBD>&|<7C>0
|
||||
123
Utils/DevDiskImageDeployer.py
Normal file
123
Utils/DevDiskImageDeployer.py
Normal file
@@ -0,0 +1,123 @@
|
||||
# support_deployer.py
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Iterable, Optional
|
||||
|
||||
VERSION_RE = re.compile(r"^\d+(?:\.\d+)*$") # 15 / 15.6 / 16.7 / 16.7.1
|
||||
|
||||
def _find_support_root(hint: Optional[Path]) -> Optional[Path]:
|
||||
"""
|
||||
1) 优先:显式传入的 hint
|
||||
2) 其次:环境变量 SUPPORT_DDI_DIR
|
||||
3) 再次:从 __file__ 所在目录向上搜索 3 层,找名为 'SupportFiles' 的目录
|
||||
"""
|
||||
# 1) 显式参数
|
||||
if hint and hint.exists():
|
||||
return hint.resolve()
|
||||
|
||||
# 2) 环境变量
|
||||
env = os.environ.get("SUPPORT_DDI_DIR")
|
||||
if env:
|
||||
p = Path(env).expanduser()
|
||||
if p.exists():
|
||||
return p.resolve()
|
||||
|
||||
# 3) 向上搜索
|
||||
here = Path(__file__).resolve().parent
|
||||
for i in range(4): # 当前目录 + 向上 3 层
|
||||
cand = here / "SupportFiles"
|
||||
if cand.exists():
|
||||
return cand.resolve()
|
||||
here = here.parent
|
||||
|
||||
return None
|
||||
|
||||
|
||||
@dataclass
|
||||
class DevDiskImageDeployer:
|
||||
"""
|
||||
同步 SupportFiles/<version>/... 到 ~/.tidevice/device-support/<version>/...
|
||||
- 自动定位 SupportFiles(显式参数/环境变量/向上搜索)
|
||||
- 已存在则跳过,不存在才复制
|
||||
- 详细日志
|
||||
"""
|
||||
project_support_root: Optional[Path] = None # 可不传,自动发现
|
||||
cache_root: Optional[Path] = None # 默认 ~/.tidevice/device-support
|
||||
verbose: bool = True
|
||||
dry_run: bool = False
|
||||
overwrite: bool = False
|
||||
|
||||
_src_dir: Path = field(init=False, repr=False)
|
||||
_cache_dir: Path = field(init=False, repr=False)
|
||||
|
||||
def __post_init__(self):
|
||||
src = _find_support_root(self.project_support_root)
|
||||
if src is None:
|
||||
raise FileNotFoundError(
|
||||
"未找到 SupportFiles 目录。"
|
||||
"可传入 project_support_root,或设置环境变量 SUPPORT_DDI_DIR,"
|
||||
"或确保在当前文件上层 3 级目录内存在名为 'SupportFiles' 的目录。"
|
||||
)
|
||||
self._src_dir = src
|
||||
|
||||
if self.cache_root is None:
|
||||
self._cache_dir = Path.home() / ".tidevice" / "device-support"
|
||||
else:
|
||||
self._cache_dir = Path(self.cache_root).expanduser().resolve()
|
||||
self._cache_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
if self.verbose:
|
||||
print(f"[INFO] resolved SupportFiles = {self._src_dir}")
|
||||
print(f"[INFO] cache_dir = {self._cache_dir}")
|
||||
|
||||
# 打印一眼能看见的兄弟目录,防路径误判
|
||||
parent = self._src_dir.parent
|
||||
try:
|
||||
siblings = ", ".join(sorted(p.name for p in parent.iterdir() if p.is_dir()))
|
||||
print(f"[INFO] SupportFiles parent = {parent}")
|
||||
print(f"[INFO] siblings = {siblings}")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def deploy_all(self):
|
||||
candidates = list(self._iter_version_dirs(self._src_dir))
|
||||
if self.verbose:
|
||||
if not candidates:
|
||||
print("[WARN] 未发现任何版本目录(仅匹配 15 / 15.6 / 16.7 / 16.7.1 这种名字)")
|
||||
else:
|
||||
print("[INFO] 发现版本目录:")
|
||||
for c in candidates:
|
||||
print(f" - {c.name}")
|
||||
|
||||
copied = skipped = 0
|
||||
for ver_dir in candidates:
|
||||
dst = self._cache_dir / ver_dir.name
|
||||
if dst.exists() and not self.overwrite:
|
||||
if self.verbose:
|
||||
print(f"[SKIP] 已存在:{dst}")
|
||||
skipped += 1
|
||||
continue
|
||||
|
||||
if dst.exists() and self.overwrite:
|
||||
if self.verbose:
|
||||
print(f"[INFO] 覆盖模式,删除:{dst}")
|
||||
if not self.dry_run:
|
||||
shutil.rmtree(dst)
|
||||
|
||||
if self.verbose:
|
||||
print(f"[COPY] {ver_dir} -> {dst}")
|
||||
if not self.dry_run:
|
||||
shutil.copytree(ver_dir, dst)
|
||||
copied += 1
|
||||
|
||||
if self.verbose:
|
||||
print(f"[SUMMARY] copied={copied}, skipped={skipped}, total={copied+skipped}")
|
||||
|
||||
# -------- helpers --------
|
||||
def _iter_version_dirs(self, root: Path) -> Iterable[Path]:
|
||||
for p in sorted(root.iterdir()):
|
||||
if p.is_dir() and VERSION_RE.match(p.name):
|
||||
yield p
|
||||
@@ -18,6 +18,7 @@ python -m nuitka Module/Main.py ^
|
||||
--include-module=urllib3 ^
|
||||
--include-module=certifi ^
|
||||
--include-module=idna ^
|
||||
--include-data-dir="E:/Code/python/iOSAI/SupportFiles=SupportFiles" ^
|
||||
--include-data-dir="E:/Code/python/iOSAI/resources=resources" ^
|
||||
--include-data-files="E:/Code/python/iOSAI/resources/iproxy/*=resources/iproxy/" ^
|
||||
--windows-icon-from-ico=resources/icon.ico
|
||||
Reference in New Issue
Block a user