临时提交
This commit is contained in:
@@ -7,12 +7,10 @@ import time
|
||||
from pathlib import Path
|
||||
from queue import Queue
|
||||
from typing import Any, Dict
|
||||
|
||||
from Entity import Variables
|
||||
from Utils.AiUtils import AiUtils
|
||||
from Utils.IOSAIStorage import IOSAIStorage
|
||||
from Utils.LogManager import LogManager
|
||||
import tidevice
|
||||
import wda
|
||||
from flask import Flask, request
|
||||
from flask_cors import CORS
|
||||
@@ -107,7 +105,6 @@ def _apply_device_event(obj: Dict[str, Any]):
|
||||
def _handle_conn(conn: socket.socket, addr):
|
||||
"""统一的连接处理函数(外部全局,避免内嵌函数覆盖)"""
|
||||
try:
|
||||
# LogManager.info(f"[SOCKET][ACCEPT] from={addr}")
|
||||
with conn:
|
||||
buffer = ""
|
||||
while True:
|
||||
|
||||
@@ -72,7 +72,6 @@ class FlaskSubprocessManager:
|
||||
|
||||
env = os.environ.copy()
|
||||
env["FLASK_COMM_PORT"] = str(self.comm_port)
|
||||
|
||||
exe_path = Path(sys.executable).resolve()
|
||||
if exe_path.name.lower() in ("python.exe", "pythonw.exe"):
|
||||
exe_path = Path(sys.argv[0]).resolve()
|
||||
|
||||
@@ -4,6 +4,8 @@ import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from Utils.LogManager import LogManager
|
||||
|
||||
if "IOSAI_PYTHON" not in os.environ:
|
||||
base_path = Path(sys.argv[0]).resolve()
|
||||
base_dir = base_path.parent if base_path.is_file() else base_path
|
||||
@@ -28,7 +30,7 @@ print(f"日志目录: {LOG_DIR}")
|
||||
|
||||
def _run_flask_role():
|
||||
from Module import FlaskService
|
||||
port = int(os.getenv("FLASK_COMM_PORT", "34567")) # 固定端口的兜底仍是 34567
|
||||
port = int(os.getenv("FLASK_COMM_PORT", "34566")) # 固定端口的兜底仍是 34567
|
||||
app_factory = getattr(FlaskService, "create_app", None)
|
||||
app = app_factory() if callable(app_factory) else FlaskService.app
|
||||
app.run(host="0.0.0.0", port=port + 1, debug=False, use_reloader=False)
|
||||
@@ -37,19 +39,18 @@ if "--role=flask" in sys.argv:
|
||||
_run_flask_role()
|
||||
sys.exit(0)
|
||||
|
||||
# 启动锁
|
||||
def main(arg):
|
||||
print(arg)
|
||||
if len(arg) != 2:
|
||||
if len(arg) != 2 or arg[1] != "iosai":
|
||||
sys.exit(0)
|
||||
else:
|
||||
if arg[1] != "iosai":
|
||||
sys.exit(0)
|
||||
|
||||
# 项目入口
|
||||
if __name__ == "__main__":
|
||||
|
||||
# 获取启动时候传递的参数
|
||||
main(sys.argv)
|
||||
# 清空日志
|
||||
LogManager.clearLogs()
|
||||
|
||||
# main(sys.argv)
|
||||
|
||||
# 添加iOS开发包到电脑上
|
||||
deployer = DevDiskImageDeployer(verbose=True)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user