fix: auto-start local adb daemon and optimize path discovery across Linux, macOS and Windows
This commit is contained in:
1 parent
8b3cfe9bb3
commit
41b1b94706
7 files changed
+114
No files matched your search
@@ -211,17 +211,21 @@ def heal_adb_keys(adb_path: str | None = None, force: bool = False) -> dict[str,
|
||||
|
||||
# Restart ADB server to trigger key generation
|
||||
try:
|
||||
clean_env = os.environ.copy()
|
||||
clean_env.pop("ADB_SERVER_SOCKET", None)
|
||||
subprocess.run(
|
||||
[resolved_adb, "kill-server"],
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
timeout=5,
|
||||
env=clean_env,
|
||||
)
|
||||
subprocess.run(
|
||||
[resolved_adb, "start-server"],
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
timeout=5,
|
||||
env=clean_env,
|
||||
)
|
||||
# Execute adb devices to trigger initial handshake & key material generation if needed
|
||||
subprocess.run(
|
||||
@@ -229,6 +233,7 @@ def heal_adb_keys(adb_path: str | None = None, force: bool = False) -> dict[str,
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
timeout=5,
|
||||
env=clean_env,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Error restarting ADB server during key healing: {e}")
|
||||
|
||||
Reference in new issue
Block a user