's'
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user