Add docs note that the pcapd service is only available over USB

This commit is contained in:
Jackson Coxson
2025-09-04 19:37:10 -06:00
parent ddd2f84dd1
commit 2b678369e7
2 changed files with 4 additions and 16 deletions

View File

@@ -1,4 +1,5 @@
//! Abstraction for pcapd
//! Note that this service only works over USB or through RSD.
use plist::Value;
use tokio::io::AsyncWrite;
@@ -11,6 +12,7 @@ const ETHERNET_HEADER: &[u8] = &[
];
/// Client for interacting with the pcapd service on the device.
/// Note that this service only works over USB or through RSD.
pub struct PcapdClient {
/// The underlying device connection with established service
pub idevice: Idevice,

View File

@@ -15,18 +15,6 @@ async fn main() {
let matches = Command::new("pcapd")
.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::new("udid")
.value_name("UDID")
@@ -54,11 +42,9 @@ async fn main() {
}
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 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,
Err(e) => {
eprintln!("{e}");
@@ -68,7 +54,7 @@ async fn main() {
let mut logger_client = PcapdClient::connect(&*provider)
.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();