Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

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

USB Support (Experimental)

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

pip install adb-shell[usb]


To utilize the async version of this code, you must install into a Python 3.6+ environment.

Example Usage

(Based on androidtv/

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

# Connect (no authentication necessary)
device1 = AdbDeviceTcp('', 5555, default_timeout_s=9.)

# Connect (authentication required)
with open('path/to/adbkey') as f:
    priv =
signer = PythonRSASigner('', priv)
device2 = AdbDeviceTcp('', 5555, default_timeout_s=9.)
device2.connect(rsa_keys=[signer], auth_timeout_s=0.1)

# Connect via USB (package must be installed via `pip install adb-shell[usb])`
with open('path/to/adbkey') as f:
    priv =
signer = PythonRSASigner('', priv)
device3 = AdbDeviceUsb('ab78c6ef')
device3.connect(rsa_keys=[signer], auth_timeout_s=0.1)

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

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.1.6
Filename, size File type Python version Upload date Hashes
Filename, size adb_shell-0.1.6-py3-none-any.whl (47.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size adb_shell-0.1.6.tar.gz (36.1 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