adb

Python ADB + Fastboot implementation

https://github.com/google/python-adb

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.5%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Python ADB + Fastboot implementation

Basic Info
  • Host: GitHub
  • Owner: google
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 179 KB
Statistics
  • Stars: 1,835
  • Watchers: 109
  • Forks: 363
  • Open Issues: 72
  • Releases: 1
Archived
Created about 12 years ago · Last pushed over 2 years ago
Metadata Files
Readme License

README.md

python-adb

Coverage Status Build Status

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.

Using as standalone tool

Install using pip:

sh pip install adb

Once installed, two new binaries should be available: pyadb and pyfastboot.

sh 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

Using as a Python Library

A presentation was made at PyCon 2016, and here's some demo code:

```python import os.path as op

from adb import adbcommands from adb import signcryptography

KitKat+ devices require authentication

signer = sign_cryptography.CryptographySigner( op.expanduser('~/.android/adbkey'))

Connect to the device

device = adbcommands.AdbCommands() device.ConnectDevice( rsakeys=[signer])

Now we can use Shell, Pull, Push, etc!

for i in xrange(10): print device.Shell('echo %d' % i) ```

Pros

  • Simpler code due to use of libusb1 and Python.
  • API can be used by other Python code easily.
  • Errors are propagated with tracebacks, helping debug connectivity issues.
  • No daemon outliving the command.
  • Can be packaged as standalone zips that can be run independent of the CPU architecture (e.g. x86 vs ARM).

Cons

  • Technically slower due to Python, mitigated by no daemon.
  • Only one command per device at a time.
  • More dependencies than Android's ADB.

Dependencies

  • libusb1 (1.0.16+)
  • python-libusb1 (1.2.0+)
  • adb.zip: one of:
    • py-cryptography
    • python-rsa (3.2+)
  • fastboot.zip (optional):
    • python-progressbar (2.3+)

History

1.0.0

  • Initial version

1.1.0

  • Added TcpHandle (jameyhicks)
  • Various timing and other changes (alusco)

1.2.0

  • Update to libusb1 1.6+ (bytearray output)
  • Add support for Python 3.6
  • Create adb.zip and fastboot.zip as executable tools.
  • Add Travis CI integration
  • Support multiple crypto libraries (M2Crypto + python-rsa)
  • Push directories

1.3.0

Backwards Incompatible changes

adb_commands.AdbCommands() is now a normal class rather than a collection of staticmethods. Using the following example code to get started: py device = adb_commands.AdbCommands() device.ConnectDevice(rsa_keys=[signer])

Other changes/fixes

Many changes since 1.2.0!

  • New entrypoints exposed by pip: pyadb and pyfastboot
  • Lots of Python 2/3 compatibility fixes
  • Windows compatibility fixes
  • Transfer progress available (Push, Pull, Install)
  • Handle some misbehaving devices (double CLSE bug)
  • New options for Push and Install (st_mode and grant_permissions)

Owner

  • Name: Google
  • Login: google
  • Kind: organization
  • Email: opensource@google.com
  • Location: United States of America

Google ❤️ Open Source

GitHub Events

Total
  • Watch event: 50
  • Fork event: 7
Last Year
  • Watch event: 50
  • Fork event: 7

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 92
  • Total Committers: 23
  • Avg Commits per committer: 4.0
  • Development Distribution Score (DDS): 0.772
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Fahrzin Hemmati f****m@g****m 21
Fahrzin Hemmati f****m@u****m 12
Jamey Hicks j****s@q****m 9
Alex Lusco a****o@g****m 8
Fahrzin Hemmati f****m@g****m 7
Mohammad Abu-Garbeyyeh m****0@g****m 6
Marc-Antoine Ruel m****l@c****g 5
greateggsgreg 3****g@u****m 5
Halastra t****y@g****m 2
Tarek Galal t****l@g****m 2
dbonafilia d****a@g****m 2
Piotr Kucharski b****f@g****m 2
Francois Gervais f****s@g****m 1
Jeff Irion J****n@u****m 1
Max Borghino m****b@t****m 1
Mathieu m****x@g****m 1
llliuyx l****x@a****m 1
Josip Delic d****i@g****m 1
Sytone s****e@u****m 1
farthornas k****s@g****m 1
ktechmidas d****l@m****t 1
Max Borghino f****o@g****m 1
tuxuser t****0@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 66
  • Total pull requests: 34
  • Average time to close issues: 3 months
  • Average time to close pull requests: 4 months
  • Total issue authors: 57
  • Total pull request authors: 23
  • Average comments per issue: 2.44
  • Average comments per pull request: 4.5
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • fahhem (3)
  • JeffLIrion (3)
  • bannsec (3)
  • caffeinatedMike (2)
  • vBlackOut (2)
  • baruchl (2)
  • alongstar518 (1)
  • wolfyy59 (1)
  • deeppility (1)
  • a1ex4 (1)
  • Danny89530 (1)
  • zgoda-mobica (1)
  • pedrofsantoscom (1)
  • ChapiIL (1)
  • eismog (1)
Pull Request Authors
  • g1im2 (3)
  • JeffLIrion (3)
  • joeleong (3)
  • Halastra (3)
  • penn5 (2)
  • bif-g (2)
  • embray (2)
  • ghost (1)
  • lsd-cat (1)
  • YSunLIN (1)
  • llliuyx (1)
  • GeekTan (1)
  • pmldrmota (1)
  • cclauss (1)
  • matthieuxyz (1)
Top Labels
Issue Labels
help wanted (2)
Pull Request Labels

Packages

  • Total packages: 5
  • Total downloads:
    • pypi 3,151 last-month
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 18
    (may contain duplicates)
  • Total versions: 8
  • Total maintainers: 6
pypi.org: adb

A pure python implementation of the Android ADB and Fastboot protocols

  • Versions: 3
  • Dependent Packages: 1
  • Dependent Repositories: 14
  • Downloads: 1,746 Last month
Rankings
Stargazers count: 1.7%
Forks count: 2.7%
Average: 3.6%
Dependent repos count: 3.9%
Dependent packages count: 4.7%
Downloads: 5.1%
Maintainers (2)
Last synced: 11 months ago
pypi.org: adb-homeassistant

A pure python implementation of the Android ADB and Fastboot protocols

  • Versions: 2
  • Dependent Packages: 1
  • Dependent Repositories: 2
  • Downloads: 1,365 Last month
Rankings
Stargazers count: 1.7%
Forks count: 2.7%
Dependent packages count: 4.7%
Average: 7.8%
Dependent repos count: 11.6%
Downloads: 18.4%
Maintainers (1)
Last synced: 11 months ago
pypi.org: ak-adb

A pure python implementation of the Android ADB and Fastboot protocols

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 23 Last month
Rankings
Stargazers count: 1.7%
Forks count: 2.7%
Dependent packages count: 10.0%
Average: 16.0%
Dependent repos count: 21.7%
Downloads: 44.0%
Maintainers (2)
Last synced: 11 months ago
pypi.org: frida-android-adb

A pure python implementation of the Android ADB and Fastboot protocols

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 17 Last month
Rankings
Stargazers count: 1.7%
Forks count: 2.7%
Dependent packages count: 10.0%
Average: 16.5%
Dependent repos count: 21.7%
Downloads: 46.7%
Maintainers (1)
Last synced: 11 months ago
conda-forge.org: adb

This repository contains a pure-python implementation of the ADB and Fastboot protocols, using libusb1 for USB communications.

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Forks count: 8.2%
Stargazers count: 8.9%
Average: 25.6%
Dependent repos count: 34.0%
Dependent packages count: 51.2%
Last synced: 11 months ago

Dependencies

setup.py pypi
  • libusb1 >=1.0.16
  • rsa_signer_library *