Skip to content
SakayanagiYunaPublic

About

Cancellable ADB sessions for Python with bounded reads and foreground/background scheduling.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

adblane

ADB sessions for Python with cancellation, output limits, and foreground/background scheduling. Python 3.10+, with no third-party runtime dependencies.

中文说明

Installation

Install Android Platform Tools and make adb available on your PATH. Then install adblane from this checkout:

python -m pip install .

Quick start

Choose a device serial from adb devices:

from adblane import AdbSession

with AdbSession("YOUR_DEVICE_SERIAL") as device:
    sdk = device.read(
        "getprop ro.build.version.sdk",
        timeout=5,
        max_bytes=4096,
    )
    print(sdk.decode().strip())

read() returns bytes and checks the remote command's exit status. Share one session between threads working with the same device. The context manager closes the session and its local ADB clients when you are done.

Features

  • Foreground and background priorities, with a shared concurrency limit.
  • Cancellation through threading.Event and timeouts for queued or active calls.
  • Output size limits and optional exact-length checks.
  • Reusable shell connections for small reads and exec-out for larger reads.
  • Explicit, bounded retries for read-only operations.

Documentation

License

MIT. Install Android Platform Tools separately.

About

Cancellable ADB sessions for Python with bounded reads and foreground/background scheduling.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages