mirror of
https://github.com/jkcoxson/idevice.git
synced 2026-03-02 06:26:15 +01:00
Add docs note that the pcapd service is only available over USB
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
//! Abstraction for pcapd
|
//! Abstraction for pcapd
|
||||||
|
//! Note that this service only works over USB or through RSD.
|
||||||
|
|
||||||
use plist::Value;
|
use plist::Value;
|
||||||
use tokio::io::AsyncWrite;
|
use tokio::io::AsyncWrite;
|
||||||
@@ -11,6 +12,7 @@ const ETHERNET_HEADER: &[u8] = &[
|
|||||||
];
|
];
|
||||||
|
|
||||||
/// Client for interacting with the pcapd service on the device.
|
/// Client for interacting with the pcapd service on the device.
|
||||||
|
/// Note that this service only works over USB or through RSD.
|
||||||
pub struct PcapdClient {
|
pub struct PcapdClient {
|
||||||
/// The underlying device connection with established service
|
/// The underlying device connection with established service
|
||||||
pub idevice: Idevice,
|
pub idevice: Idevice,
|
||||||
|
|||||||
@@ -15,18 +15,6 @@ async fn main() {
|
|||||||
|
|
||||||
let matches = Command::new("pcapd")
|
let matches = Command::new("pcapd")
|
||||||
.about("Capture IP packets")
|
.about("Capture IP packets")
|
||||||
.arg(
|
|
||||||
Arg::new("host")
|
|
||||||
.long("host")
|
|
||||||
.value_name("HOST")
|
|
||||||
.help("IP address of the device"),
|
|
||||||
)
|
|
||||||
.arg(
|
|
||||||
Arg::new("pairing_file")
|
|
||||||
.long("pairing-file")
|
|
||||||
.value_name("PATH")
|
|
||||||
.help("Path to the pairing file"),
|
|
||||||
)
|
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("udid")
|
Arg::new("udid")
|
||||||
.value_name("UDID")
|
.value_name("UDID")
|
||||||
@@ -54,11 +42,9 @@ async fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let udid = matches.get_one::<String>("udid");
|
let udid = matches.get_one::<String>("udid");
|
||||||
let host = matches.get_one::<String>("host");
|
|
||||||
let pairing_file = matches.get_one::<String>("pairing_file");
|
|
||||||
let out = matches.get_one::<String>("out").map(String::to_owned);
|
let out = matches.get_one::<String>("out").map(String::to_owned);
|
||||||
|
|
||||||
let provider = match common::get_provider(udid, host, pairing_file, "pcapd-jkcoxson").await {
|
let provider = match common::get_provider(udid, None, None, "pcapd-jkcoxson").await {
|
||||||
Ok(p) => p,
|
Ok(p) => p,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
eprintln!("{e}");
|
eprintln!("{e}");
|
||||||
@@ -68,7 +54,7 @@ async fn main() {
|
|||||||
|
|
||||||
let mut logger_client = PcapdClient::connect(&*provider)
|
let mut logger_client = PcapdClient::connect(&*provider)
|
||||||
.await
|
.await
|
||||||
.expect("Failed to connect to pcapd");
|
.expect("Failed to connect to pcapd! This service is only available over USB!");
|
||||||
|
|
||||||
logger_client.next_packet().await.unwrap();
|
logger_client.next_packet().await.unwrap();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user