<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XPC",
  "identifier" : "/documentation/XPC/xpc_connection_activate(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "XPC"
    ],
    "preciseIdentifier" : "c:@F@xpc_connection_activate"
  },
  "title" : "xpc_connection_activate(_:)"
}
-->

# xpc_connection_activate(_:)

Activates a new connection.

```
func xpc_connection_activate(_ connection: xpc_connection_t)
```

## Discussion

Connections start in an inactive state, so you must call [`xpc_connection_activate(_:)`](/documentation/XPC/xpc_connection_activate(_:)) on a connection before it will send or receive any messages.

Calling [`xpc_connection_activate(_:)`](/documentation/XPC/xpc_connection_activate(_:)) on an active connection has no effect. Releasing the last reference on an inactive connection that was created with a call to one of the `xpc_connection_create` functions is undefined.

For backward compatibility reasons, [`xpc_connection_resume(_:)`](/documentation/XPC/xpc_connection_resume(_:)) on an inactive and not otherwise suspended XPC connection has the same effect as calling [`xpc_connection_activate(_:)`](/documentation/XPC/xpc_connection_activate(_:)). For new code, using [`xpc_connection_activate(_:)`](/documentation/XPC/xpc_connection_activate(_:)) is preferred.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)