Skip to main content

Crate adbutils

Crate adbutils 

Source
Expand description

Async Rust client for the Android Debug Bridge (adb) server smartsocket protocol. A port of adbutils-python.

let adb = adbutils::AdbClient::default();
for device in adb.device_list().await? {
    println!("{}: {}", device.serial().unwrap_or("?"), device.shell("echo hi").await?);
}

Re-exports§

pub use client::AdbClient;
pub use device::AdbDevice;
pub use sync::Sync;
pub use errors::AdbError;
pub use errors::Result;
pub use proto::*;

Modules§

apk
Minimal APK inspection. Replacement for the apkutils dependency used by install.py — just enough to recover the package name from a binary AndroidManifest.xml, which is all the install flow needs (launch uses monkey, so the main activity is not required).
client
adb server host commands. Port of BaseClient (_adb.py) + AdbClient (__init__.py).
conn
Async smartsocket connection. Port of AdbConnection in adbutils/_adb.py.
device
Device operations. Port of BaseDevice (_device_base.py).
errors
Error types. Port of adbutils/errors.py.
install
APK install. Port of adbutils/install.py (InstallExtension).
pidcat
Compact logcat colorizer. Inspired by adbutils/pidcat.py (a port of Jake Wharton’s pidcat). This is a focused subset: it streams logcat -v brief, filters by minimum priority and optional tag substrings, and colorizes the priority column with ANSI codes.
proto
Wire data types. Port of adbutils/_proto.py.
screenrecord
Screen recording. Port of adbutils/screenrecord.py.
screenshot
Screen capture. Port of adbutils/screenshot.py (ScreenshotExtesion).
shell
High-level shell helpers. Port of adbutils/shell.py (ShellExtension).
sync
File sync sub-protocol. Port of adbutils/sync.py.
utils
Helpers. Port of adbutils/_utils.py (subset; extended in later milestones).

Functions§

adb
Construct a client pointed at the default adb server (127.0.0.1:5037, overridable via ANDROID_ADB_SERVER_HOST / ANDROID_ADB_SERVER_PORT). Equivalent to the module-level adb singleton in the Python library.