---
title: "agent(plistName:)"
framework: servicemanagement
role: symbol
role_heading: Type Method
path: "servicemanagement/smappservice/agent(plistname:)"
---

# agent(plistName:)

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

## Declaration

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

## Parameters

- `plistName`: The name of the property list corresponding to the doc://com.apple.servicemanagement/documentation/ServiceManagement/SMAppService.

## Discussion

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

## See Also

### Managing apps

- [mainApp](servicemanagement/smappservice/mainapp.md)
- [daemon(plistName:)](servicemanagement/smappservice/daemon(plistname:).md)
- [loginItem(identifier:)](servicemanagement/smappservice/loginitem(identifier:).md)
