Skip to main content

A Python implementation of ADB with shell and FileSync functionality.

Project description

https://travis-ci.com/JeffLIrion/adb_shell.svg?branch=master https://coveralls.io/repos/github/JeffLIrion/adb_shell/badge.svg?branch=master https://pepy.tech/badge/adb-shell

Documentation for this package can be found at https://adb-shell.readthedocs.io/.

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

Installation

pip install adb-shell

Async

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/adb_manager.py)

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 = f.read()
 with open(adbkey + '.pub') as f:
     pub = f.read()
signer = PythonRSASigner(pub, priv)

# Connect
device1 = AdbDeviceTcp('192.168.0.222', 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 = device1.shell('echo TEST1')
response2 = device2.shell('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.

Source Distribution

adb_shell-0.3.2.tar.gz (38.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adb_shell-0.3.2-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

Details for the file adb_shell-0.3.2.tar.gz.

File metadata

  • Download URL: adb_shell-0.3.2.tar.gz
  • Upload date:
  • Size: 38.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for adb_shell-0.3.2.tar.gz
Algorithm Hash digest
SHA256 dbb23297e8c768044ff8e5aee24bc0fc4aac7152964d33b31489831a4a52e587
MD5 d65213e22b6825c6c01ba346871b24a5
BLAKE2b-256 4bfe97c1978e714a26b1600d71ae3471307208ae110db713c4c97ccd194b3e2d

See more details on using hashes here.

File details

Details for the file adb_shell-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: adb_shell-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 49.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for adb_shell-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c5e9017eb534ecb4cc406cf08c4479972987772573ec8eb507de3d831b2359a
MD5 e330c6d50ce106fc30b18d6130f796a0
BLAKE2b-256 611b20e7c2164bc759fe11eb06ff3bd9acb259724f0dce5bad569e74ab42ff44

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page