Architecture
How idevice is layered internally.
idevice is built around a few small layers:
usbmuxdfinds USB-connected devices and opens sockets to them.LockdownClientstarts device services through lockdown on port62078.IdeviceProviderhides where the connection comes from.IdeviceServicegives services a sharedconnect()pattern.RsdServicecovers services reached through RSD on newer iOS versions.RemoteXpcClientspeaks XPC over HTTP/2.CoreDeviceServiceClientwraps newer CoreDevice services.
Lockdown-backed services use this path:
usbmuxd -> lockdown -> start_service -> service port -> optional TLSiOS 17+ RSD/CoreDevice developer services use this path:
RSD handshake -> RemoteXPC -> CoreDevice tunnel -> XPC serviceMain traits
IdeviceProvider is the main abstraction for opening connections. A provider
can represent a USB device through usbmuxd, a network device over TCP, or a
newer RSD/CoreDevice path.
IdeviceService is the shared pattern for lockdown-backed services. A service
declares its service name, asks lockdown to start it, opens the returned port,
and wraps the stream.
RsdService is the equivalent shape for services reached through RSD. These
services do not use the older lockdown start_service flow.