<!--
{
  "availability" : [
    "macOS: 10.6.0 - 13.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "ServiceManagement",
  "identifier" : "/documentation/ServiceManagement/SMLoginItemSetEnabled(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Service Management"
    ],
    "preciseIdentifier" : "c:@F@SMLoginItemSetEnabled"
  },
  "title" : "SMLoginItemSetEnabled(_:_:)"
}
-->

# SMLoginItemSetEnabled(_:_:)

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

```
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

Returns <doc://com.apple.documentation/documentation/Swift/true> if the requested change has taken effect.

## Discussion

> Important:
> To enable or disable `LoginItems` in macOS 13 and later, use the ``doc://com.apple.servicemanagement/documentation/ServiceManagement/SMAppService/register()`` and ``doc://com.apple.servicemanagement/documentation/ServiceManagement/SMAppService/unregister()`` methods instead.

The build system places helper executables in the app’s bundle in the `Contents/Library/LoginItems` 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)