<!--
{
  "availability" : [
    "iOS: -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ServiceManagement",
  "identifier" : "/documentation/ServiceManagement/SMAppService/agent(plistName:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Service Management"
    ],
    "preciseIdentifier" : "c:objc(cs)SMAppService(cm)agentServiceWithPlistName:"
  },
  "title" : "agent(plistName:)"
}
-->

# agent(plistName:)

Initializes an app service object with a launch agent with the property list name you provide.

```
class func agent(plistName: String) -> Self
```

## Parameters

`plistName`

The name of the property list corresponding to the [`SMAppService`](/documentation/ServiceManagement/SMAppService).

## Discussion

The property list name must correspond to a property list in the calling app’s `Contents/Library/LaunchAgents` directory.

---

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)