Crates.io | adb-client-tokio |
lib.rs | adb-client-tokio |
version | 0.0.8 |
source | src |
created_at | 2024-06-11 07:57:49.778246 |
updated_at | 2024-11-18 11:25:53.802743 |
description | A Rust library for communicating with Android devices via the Android Debug Bridge (ADB) protocol. |
homepage | |
repository | https://github.com/devicelink/adb-client-tokio |
max_upload_size | |
id | 1267929 |
size | 38,704 |
A pure rust implementation to send commands and forwards traffic to an android device using a adb server.
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(())
}
Checkout Android Source for details about the used protocols
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