Skip to main content

droidrun_adb/
lib.rs

1//! # droidrun-adb
2//!
3//! Async ADB (Android Debug Bridge) client library.
4//!
5//! Implements the ADB wire protocol directly over TCP using tokio,
6//! providing native async support for all operations.
7//!
8//! ## Usage
9//!
10//! ```no_run
11//! use droidrun_adb::{AdbServer, AdbDevice};
12//!
13//! #[tokio::main]
14//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
15//!     // Connect to first available device
16//!     let server = AdbServer::default();
17//!     let device = server.device().await?;
18//!
19//!     // Run shell command
20//!     let output = device.shell("getprop ro.build.version.sdk").await?;
21//!     println!("SDK version: {}", output.trim());
22//!
23//!     // Take screenshot
24//!     let png = device.screencap().await?;
25//!     std::fs::write("screen.png", &png)?;
26//!
27//!     Ok(())
28//! }
29//! ```
30
31pub mod connection;
32pub mod device;
33pub mod error;
34pub mod models;
35pub mod server;
36
37pub use device::AdbDevice;
38pub use error::{AdbError, Result};
39pub use models::{
40    AppDetail, CurrentApp, DeviceEvent, DeviceInfo, DeviceState, FileStat, ForwardEntry,
41    RebootMode, ReverseEntry, ScreenSize, ShellOutput, SyncDirEntry,
42};
43pub use server::AdbServer;