feat: enhance ADB path resolution and update HTTP request handling for improved flexibility
This commit is contained in:
@@ -24,10 +24,14 @@ class Adb:
|
||||
raise RuntimeError(f"找不到 adb:{explicit}")
|
||||
return cls(explicit)
|
||||
name = "adb.exe" if os.name == "nt" else "adb"
|
||||
path = REPO_ROOT / "tools" / "platform-tools" / name
|
||||
if not path.is_file():
|
||||
raise RuntimeError(f"项目内没有 adb:{path}")
|
||||
return cls(str(path))
|
||||
candidates = [
|
||||
REPO_ROOT / "tools" / "platform-tools" / name,
|
||||
REPO_ROOT / "vendor" / "platform-tools" / name,
|
||||
]
|
||||
for path in candidates:
|
||||
if path.is_file():
|
||||
return cls(str(path))
|
||||
raise RuntimeError(f"项目内没有 adb:{candidates[0]}")
|
||||
|
||||
def list_devices(self) -> list[dict]:
|
||||
proc = self._run(["devices", "-l"])
|
||||
|
||||
Reference in New Issue
Block a user