优化启动iproxy时出现的黑框
This commit is contained in:
@@ -56,7 +56,7 @@ class DeviceInfo:
|
|||||||
self._creationflags = 0
|
self._creationflags = 0
|
||||||
|
|
||||||
si = subprocess.STARTUPINFO()
|
si = subprocess.STARTUPINFO()
|
||||||
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW # type: ignore[attr-defined]
|
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
||||||
si.wShowWindow = 0 # SW_HIDE
|
si.wShowWindow = 0 # SW_HIDE
|
||||||
self._startupinfo = si
|
self._startupinfo = si
|
||||||
|
|
||||||
@@ -261,14 +261,14 @@ class DeviceInfo:
|
|||||||
|
|
||||||
args = [
|
args = [
|
||||||
iproxy_path,
|
iproxy_path,
|
||||||
"-u",
|
"-u", udid,
|
||||||
udid,
|
str(local_port), # 本地端口(投屏)
|
||||||
str(local_port), # 本地端口(投屏)
|
"9567" # 手机端口(go-ios screencast)
|
||||||
"9567", # 手机端口(go-ios screencast)
|
|
||||||
]
|
]
|
||||||
|
|
||||||
print(f"[iproxy] 启动进程: {args}")
|
print(f"[iproxy] 启动进程: {args}")
|
||||||
|
|
||||||
|
# 不用 PIPE,防止没人读导致缓冲爆掉;窗口用前面配置隐藏
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
args,
|
args,
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
@@ -276,6 +276,7 @@ class DeviceInfo:
|
|||||||
creationflags=self._creationflags,
|
creationflags=self._creationflags,
|
||||||
startupinfo=self._startupinfo,
|
startupinfo=self._startupinfo,
|
||||||
)
|
)
|
||||||
|
|
||||||
self._iproxy_process[udid] = proc
|
self._iproxy_process[udid] = proc
|
||||||
|
|
||||||
def _stop_iproxy(self, udid: str):
|
def _stop_iproxy(self, udid: str):
|
||||||
|
|||||||
Reference in New Issue
Block a user