Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

A Python implementation of ADB with shell and FileSync functionality.

Project description

Documentation for this package can be found at

This Python package implements ADB shell and FileSync functionality. It originated from python-adb.


pip install adb-shell


To utilize the async version of this code, you must install into a Python 3.7+ environment via:

pip install adb-shell[async]

USB Support (Experimental)

To connect to a device via USB, install this package via:

pip install adb-shell[usb]

Example Usage

(Based on androidtv/

from adb_shell.adb_device import AdbDeviceTcp, AdbDeviceUsb
from adb_shell.auth.sign_pythonrsa import PythonRSASigner

# Load the public and private keys
adbkey = 'path/to/adbkey'
with open(adbkey) as f:
    priv =
 with open(adbkey + '.pub') as f:
     pub =
signer = PythonRSASigner(pub, priv)

# Connect
device1 = AdbDeviceTcp('', 5555, default_transport_timeout_s=9.)
device1.connect(rsa_keys=[signer], auth_timeout_s=0.1)

# Connect via USB (package must be installed via `pip install adb-shell[usb])`
device2 = AdbDeviceUsb()
device2.connect(rsa_keys=[signer], auth_timeout_s=0.1)

# Send a shell command
response1 ='echo TEST1')
response2 ='echo TEST2')

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for adb-shell, version 0.2.3
Filename, size File type Python version Upload date Hashes
Filename, size adb_shell-0.2.3-py3-none-any.whl (48.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size adb_shell-0.2.3.tar.gz (37.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page