#adb #android

adb_client

Rust ADB (Android Debug Bridge) client library

13 unstable releases (4 breaking)

0.5.0 Apr 7, 2023
0.4.1 Feb 9, 2023
0.3.0 May 16, 2022
0.2.1 May 16, 2022
0.1.5 Jan 23, 2022

#4 in #adb

Download history 28/week @ 2023-02-12 26/week @ 2023-02-19 26/week @ 2023-02-26 8/week @ 2023-03-05 6/week @ 2023-03-12 5/week @ 2023-03-19 8/week @ 2023-03-26 32/week @ 2023-04-02 45/week @ 2023-04-09 7/week @ 2023-04-16 8/week @ 2023-04-23 6/week @ 2023-04-30 44/week @ 2023-05-07 4/week @ 2023-05-14 4/week @ 2023-05-21 15/week @ 2023-05-28

68 downloads per month

MIT license

30KB
678 lines

adb_client

Android Debug Bridge (ADB) client implementation in pure Rust !

Main features :

  • Full Rust, no need to use shell commands
  • Currently only support server TCP/IP protocol
  • Highly configurable
  • Easy to use !

Examples

First declare adb_client as a dependency by simply adding this to your Cargo.toml:

[dependencies]
adb_client = "*"

Launch a command on host device

use adb_client::AdbTcpConnexion;
use std::net::Ipv4Addr;

let mut connexion = AdbTcpConnexion::new(Ipv4Addr::from([127,0,0,1]), 5037).unwrap();
connexion.shell_command(None, vec!["df", "-h"]);

Get available ADB devices

use adb_client::AdbTcpConnexion;
use std::net::Ipv4Addr;

let mut connexion = AdbTcpConnexion::new(Ipv4Addr::from([127,0,0,1]), 5037).unwrap();
connexion.devices();

Rust binary

This crate also provides a lightweight binary based on the adb_client crate. You can install it by running the following command :

cargo install adb_client --example adb_cli 

Missing features

  • Pull / Push files
  • USB protocol

All pull requests are welcome !

Documentation

Dependencies

~1.5–2.4MB
~63K SLoC