feat: 内置并统一使用项目 ADB (#149)

This commit is contained in:
chengma
2026-08-11 12:01:07 +08:00
parent 56b1a46c5c
commit 8f2037db2f
21 changed files with 355 additions and 46 deletions
+4 -2
View File
@@ -26,6 +26,7 @@ from src.pdd_page_classifier import ( # noqa: E402
PAGE_HOME,
classify_pdd_page,
)
from src.adb_runtime import configure_bundled_adb_environment # noqa: E402
TEST_URL = "https://mobile.yangkeduo.com/goods.html"
@@ -143,15 +144,16 @@ def run_diagnostic(
address = str(device_address or "").strip()
if not address:
raise ValueError("必须提供 Android 设备地址")
adb_executable = str(configure_bundled_adb_environment())
adb_runner(
["adb", "-s", address, "get-state"],
[adb_executable, "-s", address, "get-state"],
check=True,
capture_output=True,
text=True,
)
adb_runner(
[
"adb", "-s", address, "shell", "am", "start",
adb_executable, "-s", address, "shell", "am", "start",
"-a", "android.intent.action.VIEW", "-d", TEST_URL,
],
check=True,