smix_usbmux/lib.rs
1//! Speak Apple's usbmux protocol: list attached iOS devices, and open a
2//! TCP tunnel to a port on one.
3//!
4//! A physical iPhone does not share the host's loopback, so a server
5//! running on the device — like smix's XCUITest runner — cannot be
6//! reached by connecting to `127.0.0.1` on the Mac. What bridges the two
7//! is `usbmuxd`, and the good news is that it is **Apple's own daemon,
8//! shipped with macOS**: `/var/run/usbmuxd` is there on any machine with
9//! the developer tools.
10//!
11//! So the third-party library usually reached for at this point turns out
12//! to be a client wrapper around something already present. What is left
13//! to write is the protocol itself, and it is small: a 16-byte header and
14//! a plist with four keys. That is this crate (IR-1 — what cannot be
15//! self-made here is the daemon, and it is not ours to make).
16
17pub mod conn;
18pub mod forward;
19pub mod plist;
20pub mod wire;
21
22pub use conn::{Device, UsbmuxError, connect, find_by_serial, list_devices};
23pub use forward::{Forward, forward};