Guest User

ADB

a guest
Jun 25th, 2025
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. Prerequisites
  2. • Android device with USB debugging enabled (Settings → Developer options → USB debugging)
  3. • USB cable and free USB port on your PC
  4. • Android SDK Platform-Tools unzipped (e.g. C:\adb\platform-tools)
  5. • Python 3 installed globally
  6.  
  7. Start ADB & confirm device
  8. • Open PowerShell or CMD
  9. • Change into your Platform-Tools folder:
  10. cd C:\adb\platform-tools
  11. • Run:
  12. adb.exe start-server
  13. adb.exe devices
  14. • Verify your device serial appears under “List of devices attached.”
  15.  
  16. Install Python packages
  17. • In any console window, run:
  18. pip install --upgrade pip
  19. pip install pure-python-adb numpy pillow
  20.  
  21. Prepare script & image
  22. • Place your draw.py script in a folder, e.g. (downloaded from https://gist.github.com/paciops/40c22ebd2d14aa330220a6d12731fcfa)
  23. C:\path\to\draw.py
  24. • Put your image file in a known location, e.g.
  25. C:\path\to\your\image.jpg
  26.  
  27. Run the drawing script
  28. • In PowerShell/CMD, execute:
  29. python C:\path\to\draw.py C:\path\to\your\image.jpg
  30. • Watch for console logs (“Connected to…”, “Total swipes…”) and the image being drawn on your device.
  31.  
  32. Troubleshooting
  33. • No device listed: check cable, USB port and re-authorize USB debugging on the phone
  34. • Permission denied on device.shell(...): revoke and re-allow USB debugging
  35. • Swipes off-screen or invisible: print out mapped coordinates in your script and adjust screen_start_x, screen_start_y or scale
  36. • ADB server errors:
  37. adb.exe kill-server
  38. adb.exe start-server
Advertisement
Add Comment
Please, Sign In to add comment