auto-save 2026-04-01 09:03 (+8, ~2)
This commit is contained in:
38
scripts/test_device.py
Normal file
38
scripts/test_device.py
Normal 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()
|
||||
Reference in New Issue
Block a user