<!--
{
  "availability" : [
    "macOS: 15.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DeviceManagement",
  "identifier" : "/documentation/DeviceManagement/ServicesBackgroundTasks",
  "metadataVersion" : "0.1.0",
  "role" : "Object",
  "symbol" : {
    "kind" : "Object",
    "modules" : [
      "Device Management"
    ],
    "preciseIdentifier" : "rmdm-declarations:ServicesBackgroundTasks"
  },
  "title" : "ServicesBackgroundTasks"
}
-->

# ServicesBackgroundTasks

The declaration to configure background tasks.

```
object ServicesBackgroundTasks
```

## Discussion

Specify `com.apple.configuration.services.background-tasks` as the declaration type.

One or both of `ExecutableAssetReference` or `LaunchdConfigurations` needs to be present.

If `ExecutableAssetReference` is present, the POSIX permissions of the files in the zip archive need to be set correctly. For example, executables must have the “x” bit set.

If `LaunchdConfigurations` is present, the device stores the launchd configuration files in a secure location and loads them into launchd. When the device updates a launchd configuration, it kills and restarts any associated running tasks.

If both `ExecutableAssetReference` and `LaunchdConfigurations` are present, and the device changes just the executable data, it kills and restarts any running tasks associated with the launchd configurations.

> Note:
> If an executable is an app, the device can’t manage the app as it can only manage apps installed in `/Applications`. Also, the device can’t use system extensions in the app as it only loads them from apps installed in `/Applications`.

### Configuration availability

|||
|--------------------------------|----------------------------------------------|
|Allowed in supervised enrollment|macOS                                         |
|Allowed in device enrollment    |N/A                                           |
|Allowed in user enrollment      |N/A                                           |
|Allowed in local enrollment     |N/A                                           |
|Allowed in system scope         |macOS                                         |
|Allowed in user scope           |N/A                                           |
|Apply                           |Multiple configurations are applied separately|

### Configuration example

This configuration sets up a background task using a launchd daemon.

```json
{
    "Type": "com.apple.configuration.services.background-tasks",
    "Identifier": "EB13EE2B-5D63-4EBA-810F-5B81D07F5017",
    "ServerToken": "E180CA9A-F089-4FA3-BBDF-94CC159C4AE8",
    "Payload": {
        "TaskType": "com.example.bgtask",
        "TaskDescription": "Test script",
        "ExecutableAssetReference": "5840A1CB-A769-4C08-8968-13E8BA705B3E",
        "LaunchdConfigurations": [
            {
                "FileAssetReference": "F6A59159-FFA5-4DA9-B2E8-316AC4C99C78",
                "Context": "daemon"
            }
        ]
    }
}
```

## Topics

### Objects

[`ServicesBackgroundTasksLaunchdItemObject`](/documentation/DeviceManagement/ServicesBackgroundTasksLaunchdItemObject)

A dictionary of launchd configurations.



---

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)