Skip to main content

HsOjo's Python3 Android Debug Bridge. Support For App/File/Input/Display Management...

Project description

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

  1. Open the release page to find the latest version of the installation file.

  2. (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
  1. 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)
if len(adb.devices) > 0:
    device = adb.devices[0]
    print(device.sn, device.state)
    print(device.app.current_activity)
    print(device.input.keyevent(KeyCode.HOME))
    print(device.input.keyevent(KeyCode.SEARCH))
    print(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))

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

OjoPyADB-0.0.2.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

OjoPyADB-0.0.2-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file OjoPyADB-0.0.2.tar.gz.

File metadata

  • Download URL: OjoPyADB-0.0.2.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for OjoPyADB-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2a7a493a2abf23f9ab2ff6e47f1e4c78d8225de05c92da7135323ccbfb3d4c33
MD5 fbdb679a796b10fcd7332888c45afd7e
BLAKE2b-256 750e2dfcfc3cbeb830008df6201283a61e719000beaf0cc6512447c6f5848aab

See more details on using hashes here.

File details

Details for the file OjoPyADB-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: OjoPyADB-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for OjoPyADB-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f4a77fc05edd0490e312b87e114b9cc245b17d0dc9fb555007c3ef63a03f8b36
MD5 71da50625dbac0d05c67768375e1728d
BLAKE2b-256 3aac74c582f0566557ec753b17ebaa171da18c827d6794df2f79ae01c914ff8e

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