• Stars
    star
    520
  • Rank 84,548 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Python implementation of ADB with shell and FileSync functionality.

adb_shell

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/.

Prebuilt wheel can be downloaded from nightly.link.

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')

Generate ADB Key Files

If you need to generate a key, you can do so as follows.

from adb_shell.auth.keygen import keygen

keygen('path/to/adbkey')

More Repositories

1

python-graphslam

Graph SLAM solver in Python
Python
193
star
2

python-androidtv

Communicate with an Android TV or Fire TV device via ADB over a network.
Python
161
star
3

homeassistant_native_firetv

Python
43
star
4

udacity

My work for Udacity courses
HTML
39
star
5

ha-androidtv

Same as Home Assistant's Android TV integration, but using the latest backend libraries.
Python
11
star
6

Math-Course-Notes

This repository includes various sets of notes that I took during my time in graduate school at UC Davis. My hope is that they will prove useful for others.
6
star
7

MTSG_Toolbox

The Multiscale Transforms for Signals on Graphs (MTSG) Toolbox contains MATLAB code for performing the HGLET and GHWT transforms on signals on graphs, as well as other related code.
MATLAB
6
star
8

aio-androidtv

Communicate with an Android TV or Fire TV device via ADB over a network.
Python
5
star
9

hassio-adb-server-addon

Shell
4
star
10

home-assistant-info

HTML
4
star
11

udacity_car_nanodegree_project04

https://jefflirion.github.io/udacity_car_nanodegree_project04/
HTML
4
star
12

aio_adb_shell

A Python async implementation of ADB with shell and FileSync functionality.
Python
3
star
13

udacity_car_nanodegree_project01

https://jefflirion.github.io/udacity_car_nanodegree_project01/
HTML
3
star
14

udacity_car_nanodegree_project05

https://jefflirion.github.io/udacity_car_nanodegree_project05/
HTML
2
star
15

udacity_car_nanodegree_project02

https://jefflirion.github.io/udacity_car_nanodegree_project02/
HTML
2
star
16

androidtv

Custom Home Assistant media_player component for generic Android devices.
Python
2
star
17

udacity_car_nanodegree_project03

https://jefflirion.github.io/udacity_car_nanodegree_project03/
Jupyter Notebook
2
star
18

python-package

A starter template for a Python package.
Shell
1
star