Skip to content

Glossary

XPC

Apple's IPC framework for talking between processes. Built on Mach messages with a structured codec, queue-aware dispatch, and tight launchd integration.

XPC is Apple's high-level IPC framework — the recommended way for one process to call another on macOS / iOS / etc. Implemented on top of Mach messages with:

  • A structured codec for serializing arguments (dictionaries of primitive types, plus typed objects).
  • Queue-aware dispatch — every XPC connection has an associated dispatch queue; messages arrive as block invocations on that queue.
  • Launchd integration — XPC services declared in an app bundle's Contents/XPCServices/ are spawned automatically by launchd when the app first connects.
  • Reverse-RPC — both sides can send messages; not just request/reply.

Used everywhere:

  • App ↔ helper process (Safari's renderer processes, Photos' importer, etc.).
  • Apps ↔ system daemons (LaunchServices, location, contacts).
  • Apps ↔ Apple-managed services (CloudKit, iCloud sync engines).
  • Inside frameworks for cross-process isolation (sandboxed XPC services handle dangerous parsing tasks).

The C API is xpc_* (xpc_connection_create, xpc_dictionary_set_string, xpc_connection_send_message). The Objective-C API is NSXPCConnection (typed, protocol-based, async-await-friendly).

apple-oss-distributions/xnuosfmk/ipc/ipc_kmsg.cThe Mach kmsg machinery XPC ultimately uses for transport.View on GitHub(line )

XPC services are also one of the few cleanly-isolated ways to crash a piece of an app — if your renderer process dies, the main app process restarts it without crashing.

See also: Mach message, launchd, and the Mach IPC internals article.