rsadb 0.1.1

Pure-Rust Android Debug Bridge (ADB) client: USB and TCP, no adb binary, no C
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! Run a shell command with `shell,v2:` and show stdout, stderr and the exit code.
//!
//! ```sh
//! cargo run --example shell -- 'ls -l /sdcard'
//! ```

mod common;

#[tokio::main]
async fn main() -> rsadb::Result<()> {
    let command = std::env::args().nth(1).unwrap_or_else(|| "id".to_owned());
    let device = common::connect().await?;
    let out = device.shell(&command).await?;
    print!("{}", out.stdout_text());
    eprint!("{}", out.stderr_text());
    println!("exit code: {:?}", out.exit_code);
    Ok(())
}