Expand description
§Android Debug Bridge (ADB) Client Library for async Rust
A pure rust implementation to send commands and forwards traffic to an android device using a adb server.
§Complete Example
Run a shell command on an device:
use adb_client_tokio::{Device, AdbClient};
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let mut adb = AdbClient::connect_tcp("127.0.0.1:5037").await.unwrap();
let version = adb.shell(Device::Default, "getprop ro.product.model").await?;
println!("ADB server version: {}", version);
Ok(())
}
§Protocol Details
Checkout Android Source for details about the used protocols
§Development
To inspect adb traffic you can e.g. use SOCAT like this:
socat -x -v TCP-LISTEN:8080,fork TCP:127.0.0.1:5037
Structs§
- AdbClient
- ADB client that can connect to ADB server and execute commands.
- Device
List Item - ADB device list item.
Enums§
- AdbClient
Socket Url - AdbClientSocketUrl represents a URL that can be used to connect to an ADB server.
- AdbClient
Stream - AdbClientStream represents a stream that can be used to communicate with an ADB server.
- AdbClient
Stream Owned Read Half - AdbClientStreamOwnedReadHalf represents the read half of an AdbClientStream.
- AdbClient
Stream Owned Write Half - AdbClientStreamOwnedWriteHalf represents the write half of an AdbClientStream.
- AdbError
- Error type for adb-client-tokio
- Device
- Specifiying all possibilities to connect to a device.
- Remote
- represents the options to connect
Traits§
- ToDevice
- allow external structs to convert to a device.
Type Aliases§
- Result
- Result type for adb-client-tokio