---
title: "SMLoginItemSetEnabled(_:_:)"
framework: servicemanagement
role: symbol
role_heading: Function
path: "servicemanagement/smloginitemsetenabled(_:_:)"
---

# SMLoginItemSetEnabled(_:_:)

Enables a helper executable in the main app-bundle directory.

## Declaration

```swift
func SMLoginItemSetEnabled(_ identifier: CFString, _ enabled: Bool) -> Bool
```

## Parameters

- `identifier`: The identifier of the helper executable bundle.
- `enabled`: A Boolean value that represents the state of the helper executable. This value is effective only for the currently logged-in user. If doc://com.apple.documentation/documentation/Swift/true, the helper tool executable immediately (and upon subsequent logins) and keeps running. If doc://com.apple.documentation/documentation/Swift/false, the helper executable stops.

## Return Value

Return Value Returns true if the requested change has taken effect.

## Discussion

Discussion important: To enable or disable LoginItems in macOS 13 and later, use the register() and unregister() methods instead. The build system places helper executables in the app’s bundle in the Contents/Library/LoginItems directory.
