feat: 内置并统一使用项目 ADB (#149)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user