<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "os",
  "identifier" : "/documentation/os/os_activity_create",
  "metadataVersion" : "0.1.0",
  "role" : "Macro",
  "symbol" : {
    "kind" : "Macro",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "c:@macro@os_activity_create"
  },
  "title" : "os_activity_create"
}
-->

# os_activity_create

Creates a new activity object.

```
#define os_activity_create(description, parent_activity, flags)
```

## Parameters

`description`

A C string that describes the activity. The description must be a constant string within the calling executable or library.

`parent_activity`

The [`os_activity_t`](/documentation/os/os_activity_t) object that represents the parent activity. Alternatively, pass in [`OS_ACTIVITY_NONE`](/documentation/os/OS_ACTIVITY_NONE) or [`OS_ACTIVITY_CURRENT`](/documentation/os/OS_ACTIVITY_CURRENT).

`flags`

The flags to use when creating the new activity. Some flags override the parent_activity parameter; see [`os_activity_flag_t`](/documentation/os/os_activity_flag_t).

## Return Value

An [`os_activity_t`](/documentation/os/os_activity_t) object for the new activity.

## Discussion

To execute the new activity, call the [`os_activity_apply`](/documentation/os/os_activity_apply) function.

---

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)