python-adb provides a pure-Python implementation of the Android Debug Bridge protocol so you can script Android devices without depending on the platform adb binary. It exposes high-level helpers for device discovery, shell commands, file push/pull, port forwarding, and log collection, making it easy to build automation around phones and emulators. Under the hood it speaks the ADB protocol directly and can connect via USB or over TCP, which is useful for lab setups and headless servers. Because it’s Python, you can compose device actions with your favorite testing, scraping, or data-collection libraries in one process. The project also includes utilities for robust connection handling and timeouts so flaky USB links don’t derail long runs. It’s well-suited to CI test farms, large-scale telemetry, and custom device control workflows.
Features
- Pure-Python ADB client for USB and TCP connections
- Shell execution, file transfer, and log capture APIs
- Device discovery and port forwarding helpers
- Works in CI or headless servers without the adb binary
- Timeout and retry controls for unreliable links
- Easy composition with Python test and automation stacks