<!--
{
  "documentType" : "article",
  "framework" : "Xcode",
  "identifier" : "/documentation/Xcode/configuring-app-groups",
  "metadataVersion" : "0.1.0",
  "role" : "article",
  "title" : "Configuring app groups"
}
-->

# Configuring app groups

Enable communication and data sharing between multiple installed apps created
by the same developer.

## Overview

An *app group* allows multiple apps developed by the same team to access one or
more shared containers. It also enables additional interprocess communication (IPC)
between those apps using Mach IPC, POSIX semaphores and shared memory, and UNIX
domain sockets, among other IPC mechanisms. In macOS, app groups can facilitate
communication between sandboxed apps, and between sandboxed and nonsandboxed
apps. Apps can belong to one or more app groups. You can also use an app group
to share data between an app extension or App Clip and its host app.

Before creating an app group, follow the steps in
[Add a capability](/documentation/Xcode/adding-capabilities-to-your-app#Add-a-capability) to add the <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.security.application-groups> to your app’s target.

![A screenshot of Xcode’s Capabilities library with a list of available capabilities on the left and an information pane on the right. The list shows a range of capabilities from App Groups to Custom Network Protocol, and the App Groups capability is in a selected state. The text on the information pane explains that App Groups allow access to group containers that are shared among multiple related apps, and allow certain additional interprocess communication between the apps.](images/com.apple.Xcode/app-groups~dark@2x.png)

### Create app groups

After adding the app groups capability to your app,
Xcode retrieves any existing groups from your developer account and displays
them in the capability’s section. Use the Refresh button below the app groups
list to re-fetch your account’s groups at any time. Each developer account can
register a maximum of 1,000 app groups.

To register an app group, see 
[Register an app
group](https://developer.apple.com/help/account/manage-identifiers/register-an-app-group).
You need to register app groups for iOS, iPadOS, tvOS, visionOS, and watchOS apps.

Enable one or more groups in the list by selecting their checkboxes to add your
app as a member of those groups. Conversely, uncheck a group’s checkbox to
revoke your app’s membership.

To create an app group for your app, perform the following:

1. Click the Add button (+) below the App Groups list.
1. Enter a container ID in the dialog that appears. A container ID must begin
   with `group.` and then a custom string.
1. Click OK to save the new app group.

![A screenshot of the Add a new container dialog that Xcode displays after you click the Add button, which states Xcode will create a new container if the named container doesn’t already exist, add it to your App ID, and add the new container to your app’s entitlements. The text box contains the value group.com.example.mygroup.](images/com.apple.Xcode/add-app-group@2x.png)

Xcode automatically selects the new app group in the App Groups list; this
selection indicates that your app is now a member of that app group.

![A screenshot of the App Groups capability after you add it to a target. The groups list contains a single app group with the name group.com.example.mygroup.](images/com.apple.Xcode/app-group-other~dark@2x.png)

> Note:
> You can also create macOS app groups using the naming convention
> `<Developer team ID>.<group name>`.
> By using this naming scheme, macOS checks that the code
> signature of processes that try to access the app group
> container contains the same `Developer-Team-ID` as app
> group container ID.

### Access an app group’s shared container

When your app becomes a member of an app group, there are a number of APIs you
can use to read and write data to that group’s shared container, such as:

- Sharing preferences and other limited data by using the <doc://com.apple.documentation/documentation/Foundation/UserDefaults/init(suiteName:)>
  method to access the app group’s shared user defaults database.
- Retrieving the physical location of the app group’s shared container by
  calling the <doc://com.apple.documentation/documentation/Foundation/FileManager/containerURL(forSecurityApplicationGroupIdentifier:)>
  method, which you can later use to read and write data.
- Set the <doc://com.apple.documentation/documentation/Foundation/URLSessionConfiguration/sharedContainerIdentifier>
  property on the configuration of a background URL session to download files
  directly into the app group’s shared container.

You can also use an app group, which has an identifier that starts with the `group.` prefix, as a Keychain Access Group. For more information, see <doc://com.apple.documentation/documentation/Security/sharing-access-to-keychain-items-among-a-collection-of-apps>.

---

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)
