<!--
{
  "documentType" : "article",
  "framework" : "DeviceManagement",
  "identifier" : "/documentation/DeviceManagement/processing-status-for-managed-apps",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Processing status for managed apps"
}
-->

# Processing status for managed apps

Process the status that declarative management reports for managed apps.

## Discussion

Devices report the status of each declarative managed app in the [`StatusAppManagedList`](/documentation/DeviceManagement/StatusAppManagedList) status item, which device management services can subscribe to. Devices report incremental updates to the [`StatusAppManagedList`](/documentation/DeviceManagement/StatusAppManagedList) status item elements when the managed app status changes.

## Process the status item

The [`StatusAppManagedList`](/documentation/DeviceManagement/StatusAppManagedList) status item type is `app.managed.list`, which contains the device’s declarative managed apps.

The status item value is an array of objects that represent each managed app. The device reports changes incrementally to the device management service using normal status-item array value reporting behavior (see [`StatusReport`](/documentation/DeviceManagement/StatusReport)). The status includes required and optional apps, regardless of whether they are installed.

The `identifier` key is the bundle ID of the managed app and is the unique identifier for incremental reporting of the overall status item (see [`StatusReport`](/documentation/DeviceManagement/StatusReport)). The `declaration-identifier` key is the `Identifier` of the managed app configuration. Additional properties show the app’s name and version identifiers.

The `state` key indicates the app’s management state, for example, `queued`, `downloading`, `installing`, and `managed`. If an error occurs, the device reports the `failed` state with the `reasons` key for more details. The device can also include the `reasons` key for other states, providing additional information, for example, if an update for the app is available.

If a configuration provisions declarative app configurations for an app or its extensions, the app or extension reports the state back to the device management service using the `config-state` key. The device management service should communicate errors back to the administrator for corrective actions.

## Use managed app status in a predicate

Include managed app status in declarative device management activation predicates to test the status values and initiate activations based on them. To use properties of a specific app in a predicate term, use the `SUBQUERY` operator. The following example shows a predicate that evaluates to true when an app’s management state is set to `managed`:

```
SUBQUERY(@status(app.managed.list), $app, ($app.@key(identifier) == "com.example.app") AND ($app.@key(state) == "managed")).@count != 0
```

The first argument of the `SUBQUERY` specifies the `app.managed.list` status item array value. The second argument defines an internal variable, `$app`, that refers to each item in the array. The third term is a predicate expression that applies to each item in the array; if an item matches, it’s included in the array that is the result of the `SUBQUERY`. This expression uses the `$app` variable to reference the item in the `app.managed.list` it operates on.

In this example, two terms exist: one tests for a specific app bundle identifier, and the other tests the app’s state. The `@count != 0` term tests whether the `SUBQUERY` result array contains at least one matching item. So this predicate evaluates to `true` only if the app with the bundle identifier `com.example.app` is present and its management state is set to `managed`. To learn more about predicate expressions, see [Predicate Programming](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Predicates/AdditionalChapters/Introduction.html).

---

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)