This commit is contained in:
eric
2026-03-28 15:08:59 -05:00
parent 92ecc14e43
commit d74f3046a3
14 changed files with 1889 additions and 245 deletions

View File

@@ -299,6 +299,14 @@ def _is_png(data: bytes) -> bool:
return bool(data and len(data) > 8 and data.startswith(b"\x89PNG\r\n\x1a\n"))
async def android_logcat_recent(serial: str, lines: int = 200) -> str:
"""Dump recent logcat lines (logcat -d -t N), similar to device-console tooling."""
if not serial:
raise ValueError("Missing Android device serial")
n = max(1, min(int(lines), 3000))
return await _shell(serial, f"logcat -d -t {n}", timeout=60.0)
async def android_screenshot(serial: str) -> bytes:
if not serial:
raise ValueError("Missing Android device serial")