https://github.com/kpcyrd/forensic-adb
Tokio based client library for the Android Debug Bridge (adb) based on mozdevice
https://github.com/kpcyrd/forensic-adb
adb android async rust tokio-rs
Last synced: about 1 year ago
JSON representation
Tokio based client library for the Android Debug Bridge (adb) based on mozdevice
- Host: GitHub
- URL: https://github.com/kpcyrd/forensic-adb
- Owner: kpcyrd
- License: mpl-2.0
- Created: 2023-03-25T18:05:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-28T16:35:01.000Z (over 1 year ago)
- Last Synced: 2025-06-22T13:48:05.885Z (about 1 year ago)
- Topics: adb, android, async, rust, tokio-rs
- Language: Rust
- Homepage:
- Size: 135 KB
- Stars: 25
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# forensic-adb
Tokio based client library for the Android Debug Bridge (adb) based on mozdevice for Rust.
[Documentation](https://docs.rs/forensic-adb)
This code has been extracted from [mozilla-central/testing/mozbase/rust/mozdevice][1] and ported to async Rust. It also removes root detection so no commands are executed on the remote device by default.
[1]: https://hg.mozilla.org/mozilla-central/file/tip/testing/mozbase/rust/mozdevice
```rust
use forensic_adb::{AndroidStorageInput, DeviceError, Host};
#[tokio::main]
async fn main() -> Result<(), DeviceError> {
let host = Host::default();
let devices = host.devices::>().await?;
println!("Found devices: {:?}", devices);
let device = host
.device_or_default(Option::<&String>::None, AndroidStorageInput::default())
.await?;
println!("Selected device: {:?}", device);
let output = device.execute_host_shell_command("id").await?;
println!("Received response: {:?}", output);
Ok(())
}
```
## License
Mozilla Public License (MPL-2.0)