auto-save 2026-04-01 09:03 (+8, ~2)

This commit is contained in:
2026-04-01 09:04:04 +08:00
parent 0ddaa889de
commit 9709573870
70 changed files with 2331 additions and 9 deletions

38
scripts/test_device.py Normal file
View File

@@ -0,0 +1,38 @@
"""Quick test: check ADB device connection and take a screenshot."""
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from src.capture import ADBCapture
def main():
cap = ADBCapture()
print("Checking device...")
info = cap.check_device()
if not info["connected"]:
print(f"[FAIL] {info['error']}")
print()
print("Troubleshooting:")
print(" 1. USB debugging enabled on phone?")
print(" 2. Run: adb devices")
print(" 3. Accept USB debugging prompt on phone")
sys.exit(1)
print(f"[OK] Device: {info['model']}")
print(f" Serial: {info['serial']}")
print(f" Resolution: {info['resolution']}")
print(f" All devices: {info['all_devices']}")
print("\nTaking screenshot...")
img = cap.screenshot(save=True)
print(f"[OK] Screenshot: {img.size[0]}x{img.size[1]}")
print(f" Saved to: {cap.screenshot_dir}/")
if __name__ == "__main__":
main()