调整路径
This commit is contained in:
@@ -155,12 +155,21 @@ class Deviceinfo(object):
|
||||
|
||||
def _iproxy_dir(self) -> Path:
|
||||
"""返回打包后的 iproxy 目录(你现在放在 Module/iproxy/)"""
|
||||
return self._base_dir() / "Module" / "iproxy"
|
||||
return self._base_dir() / "resources" / "iproxy"
|
||||
|
||||
def _iproxy_path(self) -> Path:
|
||||
"""返回 iproxy 可执行文件路径(Windows 为 iproxy.exe)"""
|
||||
exe_name = "iproxy.exe" if os.name == "nt" else "iproxy"
|
||||
return self._iproxy_dir() / exe_name
|
||||
base = self._base_dir()
|
||||
candidates = [
|
||||
base / "resources" / "iproxy", # 新推荐:resources/iproxy/
|
||||
]
|
||||
for p in candidates:
|
||||
if p.exists():
|
||||
print("iproxy 路径为 ", p)
|
||||
return p
|
||||
|
||||
# 打一条清晰的错误便于排查
|
||||
tried = [str(c) for c in candidates]
|
||||
raise FileNotFoundError(f"iproxy not found, tried: {tried}")
|
||||
|
||||
# ----------------------------
|
||||
# 端口映射:启动 iproxy(设置 cwd 和 PATH,隐藏窗口)
|
||||
@@ -181,7 +190,7 @@ class Deviceinfo(object):
|
||||
CREATE_NO_WINDOW = 0x08000000 if os.name == "nt" else 0
|
||||
|
||||
p = subprocess.Popen(
|
||||
[str(iproxy), "-u", udid, str(self.screenProxy), "9100"],
|
||||
["iproxy", "-u", udid, str(self.screenProxy), "9100"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
creationflags=CREATE_NO_WINDOW,
|
||||
|
||||
Reference in New Issue
Block a user