Expand description
§adb_client
Rust library implementing ADB protocol.
§Installation
Add adb_client
crate as a dependency by simply adding it to your Cargo.toml
:
[dependencies]
adb_client = "*"
§Examples
§Launch a command on device via ADB server
use adb_client::ADBServer;
let mut server = ADBServer::default();
let mut device = server.get_device().expect("cannot get device");
device.shell_command(["df", "-h"],std::io::stdout());
§Get available ADB devices
use adb_client::ADBServer;
use std::net::{SocketAddrV4, Ipv4Addr};
// A custom server address can be provided
let server_ip = Ipv4Addr::new(127, 0, 0, 1);
let server_port = 5037;
let mut server = ADBServer::new(SocketAddrV4::new(server_ip, server_port));
server.devices();
§Push a file to the device
use adb_client::ADBServer;
use std::net::Ipv4Addr;
use std::fs::File;
use std::path::Path;
let mut server = ADBServer::default();
let mut device = server.get_device().expect("cannot get device");
let mut input = File::open(Path::new("/tmp")).unwrap();
device.send(&mut input, "/data/local/tmp");
Structs§
- Represents an emulator connected to the ADB server.
- Represents an ADB Server
- Represents a device connected to the ADB server.
- Represents the ADB server version.
- Represents a new device with more informations helded.
- Represents a device connected to the ADB server.
- Emulator transport running on top on TCP.
- Server transport running on top on TCP
Enums§
- Represents the connection state of the device.
- Type of reboot needed.
- Represents all error types that can be thrown by the crate.
Traits§
- Trait representing a transport
Type Aliases§
- Custom Result type thrown by this crate.