Note: This is not an official Google project. It is maintained by ex-Google engineers. For a better maintained option, look at adb_shell.
This repository contains a pure-python implementation of the ADB and Fastboot protocols, using libusb1 for USB communications.
This is a complete replacement and rearchitecture of the Android project's ADB and fastboot code
This code is mainly targeted to users that need to communicate with Android devices in an automated fashion, such as in automated testing. It does not have a daemon between the client and the device, and therefore does not support multiple simultaneous commands to the same device. It does support any number of devices and never communicates with a device that it wasn't intended to, unlike the Android project's ADB.
Install using pip:
pip install adb
Once installed, two new binaries should be available: pyadb and pyfastboot.
pyadb devices
pyadb shell ls /sdcard
Running ./make_tools.py creates two files: adb.zip and fastboot.zip. They
can be run similar to native adb and fastboot via the python interpreter:
python adb.zip devices
python adb.zip shell ls /sdcard
A presentation was made at PyCon 2016, and here's some demo code:
import os.path as op
from adb import adb_commands
from adb import sign_cryptography
# KitKat+ devices require authentication
signer = sign_cryptography.CryptographySigner(
op.expanduser('~/.android/adbkey'))
# Connect to the device
device = adb_commands.AdbCommands()
device.ConnectDevice(
rsa_keys=[signer])
# Now we can use Shell, Pull, Push, etc!
for i in xrange(10):
print device.Shell('echo %d' % i)
adb.zip: one of:
fastboot.zip (optional):
adb_commands.AdbCommands() is now a normal class rather than a collection of staticmethods. Using the following example code to get started:
device = adb_commands.AdbCommands()
device.ConnectDevice(rsa_keys=[signer])
Many changes since 1.2.0!
Push, Pull, Install)Push and Install (st_mode and grant_permissions)Overall
Maintained
Code review
PyPI
Latest release
Releases this year
779 followers · starred Aug 2017
1,515 followers · starred Jan 2019
712 followers · starred Jan 2016
752 followers · starred Sep 2017
Note: This is not an official Google project. It is maintained by ex-Google engineers. For a better maintained option, look at adb_shell.
This repository contains a pure-python implementation of the ADB and Fastboot protocols, using libusb1 for USB communications.
This is a complete replacement and rearchitecture of the Android project's ADB and fastboot code
This code is mainly targeted to users that need to communicate with Android devices in an automated fashion, such as in automated testing. It does not have a daemon between the client and the device, and therefore does not support multiple simultaneous commands to the same device. It does support any number of devices and never communicates with a device that it wasn't intended to, unlike the Android project's ADB.
Install using pip:
pip install adb
Once installed, two new binaries should be available: pyadb and pyfastboot.
pyadb devices
pyadb shell ls /sdcard
Running ./make_tools.py creates two files: adb.zip and fastboot.zip. They
can be run similar to native adb and fastboot via the python interpreter:
python adb.zip devices
python adb.zip shell ls /sdcard
A presentation was made at PyCon 2016, and here's some demo code:
import os.path as op
from adb import adb_commands
from adb import sign_cryptography
# KitKat+ devices require authentication
signer = sign_cryptography.CryptographySigner(
op.expanduser('~/.android/adbkey'))
# Connect to the device
device = adb_commands.AdbCommands()
device.ConnectDevice(
rsa_keys=[signer])
# Now we can use Shell, Pull, Push, etc!
for i in xrange(10):
print device.Shell('echo %d' % i)
adb.zip: one of:
fastboot.zip (optional):
adb_commands.AdbCommands() is now a normal class rather than a collection of staticmethods. Using the following example code to get started:
device = adb_commands.AdbCommands()
device.ConnectDevice(rsa_keys=[signer])
Many changes since 1.2.0!
Push, Pull, Install)Push and Install (st_mode and grant_permissions)Overall
Maintained
Code review
PyPI
Latest release
Releases this year
779 followers · starred Aug 2017
1,515 followers · starred Jan 2019
712 followers · starred Jan 2016
752 followers · starred Sep 2017