OjoPyADB
This project is written with Python 3, which aims to provide a simple and practical ADB function for Python 3.
Introduction
The module currently integrates the following functions:
- Application management (installation, uninstall, start, stop, clear data, freeze, get status, etc.)
- File management (pull, push, copy, move, delete, view and other basic functions)
- Input control (text, key, click, slide)
- Display management (adjust resolution, DPI, screenshot)
In the future, corresponding functions will be added according to the requirements.
How to use
As shown below.
Installation
- Starting from version 0.0.3, the module will be uploaded to pypi. You can also install it directly using pip.
pip install OjoPyADB
Manual Installation
-
Open the release page to find the latest version of the installation file.
-
(Optional) download to this machine through browser, and then use pip to execute the following command to install.
pip install OjoPyADB-0.0.1-py3-none-any.whl
- Of course, you can also directly copy the download link of the installation package and use pip for online installation. (execute the following command)
# Note: that the link here is version 0.0.1, please replace it with the latest version.
pip install https://github.com/HsOjo/OjoPyADB/releases/download/0.0.1/OjoPyADB-0.0.1-py3-none-any.whl
Example code
Here are some simple usage. For specific parameters, please refer to the code prompt of IDE. Try more.
from pyadb import PyADB, KeyCode
adb = PyADB()
print(adb.version)
print(adb.devices)
print(adb.forward.list)
if len(adb.devices) > 0:
device = list(adb.devices.values())[0]
print(device.abi)
print(device.sn, device.state)
print(device.app.current_activity)
print(device.input.keyevent(KeyCode.HOME))
print(device.input.keyevent(KeyCode.SEARCH))
device.input.text('Hello World!\tThis input method is ASCII only...')
print(device.file.listdir('/sdcard/'))
print(device.display.size())
img = device.display.screen_cap()
print(len(img))
logcat = device.logcat
logcat.set_filterspecs(**{'ActivityManager': logcat.PRIORITY_INFO})
print(logcat.dump())
Demo
See the "pyadb/demo" directory.
Metadata
Release files for OjoPyADB 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| OjoPyADB-0.2.0.tar.gz | 8.9 kB | Without provenance | Details for OjoPyADB-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| OjoPyADB-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for OjoPyADB-0.2.0-py3-none-any.whl |
Total release size: 23.3 kB
Release files / OjoPyADB-0.2.0.tar.gz
| Download URL | OjoPyADB-0.2.0.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69ffd491b87b59ad4a53b9b912a38d1c5af2943bb47bb8adef8f6ace283d60be
|
|
BLAKE2b-256 checksum How to use checksums |
672fd7373142248589f5e6438a20778dd59e2189535770460f630ef7f6464b4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.4
|
Release files / OjoPyADB-0.2.0-py3-none-any.whl
| Download URL | OjoPyADB-0.2.0-py3-none-any.whl |
|---|---|
| Size | 14.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70f18a3a94d104e0029582771acbfeffb347797a8141e9ce2f9ee243d389af0d
|
|
BLAKE2b-256 checksum How to use checksums |
a85b3968cfd1a47799c966fd5dd6b1fb09135be4ca9aa840546beb70b9941691
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.4
|
Security for OjoPyADB 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.