adbutils/lib.rs
1//! Async Rust client for the Android Debug Bridge (adb) server smartsocket
2//! protocol. A port of [adbutils-python](https://github.com/openatx/adbutils).
3//!
4//! ```no_run
5//! # async fn demo() -> adbutils::Result<()> {
6//! let adb = adbutils::AdbClient::default();
7//! for device in adb.device_list().await? {
8//! println!("{}: {}", device.serial().unwrap_or("?"), device.shell("echo hi").await?);
9//! }
10//! # Ok(())
11//! # }
12//! ```
13
14#[cfg(feature = "apk")]
15pub mod apk;
16pub mod client;
17pub mod conn;
18pub mod device;
19pub mod errors;
20#[cfg(feature = "apk")]
21pub mod install;
22pub mod pidcat;
23pub mod proto;
24#[cfg(feature = "screenrecord")]
25pub mod screenrecord;
26#[cfg(feature = "image")]
27pub mod screenshot;
28pub mod shell;
29pub mod sync;
30pub mod utils;
31
32pub use client::AdbClient;
33pub use device::AdbDevice;
34pub use sync::Sync;
35pub use errors::{AdbError, Result};
36pub use proto::*;
37
38/// Construct a client pointed at the default adb server (`127.0.0.1:5037`,
39/// overridable via `ANDROID_ADB_SERVER_HOST` / `ANDROID_ADB_SERVER_PORT`).
40/// Equivalent to the module-level `adb` singleton in the Python library.
41pub fn adb() -> AdbClient {
42 AdbClient::default()
43}