mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 14:36:16 +01:00
24 lines
666 B
Rust
24 lines
666 B
Rust
// Jackson Coxson
|
|
// Gets the devices from the muxer
|
|
|
|
use futures_util::StreamExt;
|
|
use idevice::usbmuxd::UsbmuxdConnection;
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
tracing_subscriber::fmt::init();
|
|
|
|
let mut muxer = UsbmuxdConnection::default().await.unwrap();
|
|
let res = muxer.get_devices().await.unwrap();
|
|
println!("{res:#?}");
|
|
|
|
let args: Vec<String> = std::env::args().collect();
|
|
if args.len() > 1 && args[1] == "-l" {
|
|
let mut s = muxer.listen().await.expect("listen failed");
|
|
while let Some(dev) = s.next().await {
|
|
let dev = dev.expect("failed to read from stream");
|
|
println!("{dev:#?}");
|
|
}
|
|
}
|
|
}
|