IMPORTANT It’s now possible to create a macOS provisioning profile that authorises the use of an iOS-style app group. This works in both Xcode 16.3 beta and when you manually create a profile on the Developer website. This change means that much of the following is no longer relevant. I plan to update this post with more details at some point, but I wanted to start with a quick update to highlight this important development.
I regularly see folks confused by the difference in behaviour of app groups between macOS and iOS. One day I’ll have time to write this up for the official docs (r. 92322409) but, in the meantime, here’s a quick overview.
[Well, it was a quick overview. Things have got considerably more complicated in recent years.]
If you have questions or comments, start a new thread with the details. Put it in the Privacy & Security > General topic area and tag it with Code Signing and Entitlements. Oh, and if this is about app group container protection, also include Files and Storage.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
App Groups: macOS vs iOS: Fight!
The app groups mechanism works differently on macOS and iOS. On iOS:
App group IDs start with the group. prefix.
To use an app group ID, first allocate it on the Developer website. This associates the app group ID with your team.
Then claim the app group ID in your app’s App Groups entitlement (com.apple.security.application-groups) entitlement.
Like all entitlements on iOS, that claim must be authorised by a provisioning profile. A profile will only authorise an app group ID that’s allocated by your team.
For more background on provisioning profiles, see TN3125 Inside Code Signing: Provisioning Profiles.
In contrast, on macOS:
App group IDs typically start with your Team ID.
They can’t be explicitly allocated on the Developer website.
Code that isn’t sandboxed doesn’t need to claim the app group ID in the App Groups entitlement. [1]
To use an app group, claim the app group ID in the App Groups entitlement.
The App Groups entitlement is not restricted, meaning that this claim doesn’t need to be authorised by a provisioning profile.
The App Store submission process checks that your app group IDs make sense.
IMPORTANT In this context I’m using macOS to refer to a standard macOS app. In Mac Catalyst things behave as they do on iOS. Likewise for iOS Apps on Mac. Also, anything I say about iOS also applies to tvOS, watchOS, and visionOS.
This difference is a product of the way that each platform protects app group content. On iOS the Developer website enforces group uniqueness, that is, the site prevents team B from using an app group ID that’s assigned to team A. In contrast, on macOS:
App group IDs are prefixed with the Team ID solely to prevent collisions.
The Mac App Store prevents you from publishing an app that uses an app group ID that’s used by another team.
In macOS 15 and later, all apps are subject to app group container protection.
[1] This was true prior to macOS 15. It may still technically be true in macOS 15 and later, but the most important thing, access to the app group container, requires the entitlement because of app group container protection.
Crossing the Streams
[… and mixing my pop culture metaphors!]
In some circumstances you might need to share an app group between iOS and macOS code. For example, you might have a Mac app that needs to share an app group with:
A Mac Catalyst app
An iOS app that runs on macOS via iOS Apps on Mac
The solution is to use an iOS-style app group ID in your Mac app. To do this:
Confirm that the app group ID is registered to your team on the Developer website.
Claim the app group ID in the App Groups entitlement.
If you submit that app to the Mac App Store, the submission process checks that your app group ID claims make sense, that is, they either follow the macOS convention (use a prefix of the Team ID) or the iOS convention (allocate a group ID, with the group. prefix, on the Developer website).
IMPORTANT Due to app group container protection, this approach is only viable for Mac App Store apps. For more details, see App Group Container Protection, below.
App Groups and the Keychain
The differences described above explain an oddity associated with keychain access. Consider this quote from Sharing Access to Keychain Items Among a Collection of Apps:
Application groups
When you collect related apps into an application group using the App
Groups entitlement, they share access to a group container,
and gain the ability to message each other in certain ways. Starting
in iOS 8, the array of strings given by this entitlement also extends
the list of keychain access groups.
There are three things to note here:
Using an app group ID as a keychain access group only works on iOS; it’s not supported on macOS [1] because doing so would be insecure.
The App Groups entitlement must be authorised by a provisioning profile on iOS, and that process is what protects the keychain from unauthorised access.
The required group. prefix means that these keychain access groups can’t collide with other keychain access groups, which all start with an App ID prefix (there’s also Apple-only keychain access groups that start with other prefixes, like apple).
In contrast, standard keychain access groups are protected the same way on both platforms, using the Keychain Access Groups entitlement (keychain-access-groups).
[1] Except for iOS Apps on Mac.
Not Entirely Unsatisfied
When you launch a Mac app that uses app groups you might see this log entry:
type: error
time: 10:41:35.858009+0000
process: taskgated-helper
subsystem: com.apple.ManagedClient
category: ProvisioningProfiles
message: com.example.apple-samplecode.Test92322409: Unsatisfied entitlements: com.apple.security.application-groups
Note The exact format of that log entry, and the circumstances under which it’s generated, varies by platform. On macOS 13.0.1 I was able to generate it by running a sandboxed app that claims the App Group entitlement and also claims some other restricted entitlement.
This looks kinda worrying and can be the source of problems. You see this error when you have a sandboxed app that uses an app group. In a sandboxed app your use of the app group must be authorised by the App Groups entitlement. This message is telling you that your use of the App Groups entitlement is not authorised by your provisioning profile.
On iOS this would be a show stopper. The trusted execution system would prevent your app from launching at all.
On macOS that’s not the case. The trusted execution system knows that there’s no way to get a Mac provisioning profile that authorises the App Groups entitlement, and thus it allows the app to launch anyway.
However, that’s not the end of the story. You might run into problems with:
macOS 15’s app group container protection
The entitlements validated flag
App Group Container Protection
macOS 15 introduced app group container protection. To access an app group container without user intervention:
Claim access to the app group by listing its ID in the App Groups entitlement.
Locate the container by calling the containerURL(forSecurityApplicationGroupIdentifier:) method.
Ensure that at least one of the following criteria are met:
Your app is deployed via the Mac App Store (A).
Or via TestFlight when running on macOS 15.1 or later (B).
Or the app group ID starts with your app’s Team ID (C).
Or your app’s claim to the app group is authorised by a provisioning profile embedded in the app (D) [1].
If your app doesn’t follow these rules, the system prompts the user to approve its access to the container. If granted, that consent applies only for the duration of that app instance.
For more on this, see:
The System Integrity Protection section of the macOS Sequoia 15 Release Notes
The System Integrity Protection section of the macOS Sequoia 15.1 Release Notes
WWDC 2024 Session 10123 What’s new in privacy, starting at 12:23
The above criteria mean that you rarely run into the app group authorisation prompt when your app is deployed. If you encounter a case where that happens, feel free to start a thread here on DevForums. See the top of this post for info on the topic and tags to use.
However, you might run into some issues during development:
If you have a multiplatform app built from a single target — for example, if you created the project from the Multiplatform > App template — Xcode’s Signing & Capabilities editor doesn’t understand all of these app group nuances. To work around this, conditionalise the entitlements file build setting. See this thread for more.
If you use an iOS-style app group ID in a macOS app, you might run into the authorisation prompt during day-to-day development. One way around this is to use a macOS-style app group ID during development and switch to the iOS-style app group ID for production.
[1] This is what allows Mac Catalyst and iOS Apps on Mac to work.
Entitlements Validated Flag
If your app claims the app group entitlement but that claim isn’t authorised by a provisioning profile, the trusted execution system allows the app to launch but it clears its entitlements validated flag. Some subsystems that rely on entitlements will fail in this case. The most notable example of this is the data protection keychain.
Note If you’re curious about this flag, use the procinfo subcommand of launchctl to view it. For example:
% sudo launchctl procinfo `pgrep Test20230126`
…
code signing info = valid
…
entitlements validated
…
If the flag has been cleared, this line will be missing from the code signing info section.
The practical impact of this is that, for a sandboxed app on macOS, you can either use app groups or use the data protection keychain, but not both. Needless to say, this is less than ideal (r. 104859788).
IMPORTANT This doesn’t stop you using the keychain in general. You can still use the file-based keychain. For more information about these terms, see TN3137 On Mac keychain APIs and implementations.
One place this often crops up is with Network Extension (NE) framework system extensions. These must be sandboxed and often use an app group as part of their IPC story. Specifically, they might want to publish an XPC named endpoint and, when doing that, the name listed in NEMachServiceName must be a ‘child’ of an app group.
Fortunately, system extensions are effectively daemons and so can’t use the data protection keychain anyway. So, if you’re building an NE system extension, this message is probably nothing to be worried about.
If you’re building some other program that’s affected by this, open a thread here on DevForums and let’s talk. See the top of this post for info on the topic and tags to use.
Revision History
2025-02-25 Fixed the Xcode version number mentioned in yesterday’s update.
2025-02-24 Added a quick update about the iOS-style app group IDs on macOS issue.
2024-11-05 Further clarified app group container protection. Reworked some other sections to account for this new reality.
2024-10-29 Clarified the points in App Group Container Protection.
2024-10-23 Fleshed out the discussion of app group container protection on macOS 15.
2024-09-04 Added information about app group container protection on macOS 15.
2023-01-31 Renamed the Not Entirely Unsatisfactory section to Not Entirely Unsatisfied. Updated it to describe the real impact of that log message.
2022-12-12 First posted.
Overview
Post
Replies
Boosts
Views
Activity
I'm using the iOS simulator with a StoreKit configuration file. I can see that there have been transactions while the app has been closed, but my StoreKit 2 listener is never called with those updates to be able to finish them When I open my app from a cold start.
I've added a listener on application(_:didFinishLaunching:launchOptions:) like this:
func startObservingTransactions() {
task = Task(priority: .background) {
for await result in Transaction.updates {
if case .verified(let transaction) = result {
await transaction.finish()
}
}
}
}
But the Transaction.updates loop never gets called (have added breakpoints to check). It's only ever called when a purchase is made, or subsequent transaction renewals when the app is open. Only then it will get the previously unfinished transactions.
Steps to reproduce:
Create an app with a StoreKit config file (with sped up transactions) to purchase an item
Make a purchase then quit the app
Wait for a bit for more transactions to be made while the app is closed.
Open the app from a cold start and none of the transactions will be finished by the listener in your app. Cancel the subscription via the transaction manager.
Close and open the app from a cold start. The first transaction will be finished by the listener but none of the others will be.
In Apple's docs it says
If your app has unfinished transactions, the listener receives them immediately after the app launches
Why is this not the case?
Generic parameter 'V' could not be inferred ERROR
I am trying to use the AppStoreConnect API to set the price of an app. In the documentation (here) it suggests that it is possible to set the price using the API.
"To set a price for your app using App Store Connect API, create a relationship between the apps resource and appPrices"
However it links to the instructions on how to set a price using the AppStoreConnect web site.
Looking at the website it appears that the pricing is being set by sending a PATCH to the app record itself but on the API this results in a 405 (METHOD_NOT_ALLOWED)
Is it possible to set a price using the API, and if so what endpoint should I be sending to?
I searched the Metal Shading Language Specification Version 3.0 document, however I cannot see any function for inverting a matrix. Is there really no function in Metal for inverting a matrix?
I often need to this in linear equations and have so far resorted to writing the necessary function each time, most of the time just copy-and-pasting code.
inverse exists in SIMD and GLSL, so why not in Metal? It seems so unexpected that this function does not exist that I am almost certain I have just overlooked something obvious. I even tried 1 / M, to no avail.
Hi,
The metal-cpp distribution appears to only contain headers for Foundation and Quartzcore. The LearnMetalCPP download [1] provides a ZIP with an metal-cpp-extensions directory containing AppKit.hpp and MetalKit.hpp headers. First question: Are these headers distributed anywhere else more publicly? Without these headers only the renderer can be fully written in C++ as far as I can tell, i.e. no complete C++ NSApplication. Second question: Will these headers, if needed, be maintained (e.g. updated and/or extended) by Apple along side metal-cpp?
[1] https://developer.apple.com/metal/cpp/
Thank you and regards.
if #available(iOS 16.0, *) {
print("donated")
let intent = BasicIntent()
IntentDonationManager.shared.donate(intent: intent)
}
Trying to test if donations work with the new App Intents framework.
Donating the shortcut once a user taps a button.
The shortcut is not appearing on the lock screen.
Everything else is working as expected. The Shortcut is appearing in the Shortcuts App and is working via Siri.
In developer settings I have
Display Recent Shortcuts -> On
Display Donations on Lock Screen -> On
Allow Any domain -> On
Allow Unverified sources -> On
Running iOS 16.2, iPhone 11.
I'm currently testing the announce notifications feature and I can't seem to find out how to make Siri read aloud the current currency instead of dollars.
My locale is es-CL (Chile). It uses the currency symbol $ and reads as Pesos locally or Chilean Pesos where the number 5000.1 is represented as 5.000,1
This is the notification content
let content = UNMutableNotificationContent()
content.body = "¡Has recibido un pago por $5.000!"
Siri reads it aloud as "¡Has recibido un pago por 5.000 Dolares!" which translates to "You have received a payment for 5,000 Dollars", instead of the expected "¡Has recibido un pago por 5.000 Pesos!" -> "You have received a payment for 5,000 Pesos"
I've tried changing the development region of the app, interpolating the string with NumberFormatter.localizedString(from: 5000, number: .currency), and with others styles( .currencyAccounting, .currencyISOCode and .currencyPlural) without good results. The last one seems to work buts it's not ideal since it outputs "5.000 pesos chilenos" which gets read as "5 pesos chilenos" which is not the correct amount (bug), it's as is you're not on Chile and I personally prefer it to be a symbol instead of words.
I'm testing with my device which is setup with the region "Chile"
Could someone help me find a solution?
Hello. I launched my new mobile app Drop Pin Location to promote your business or brand on the go, on January 12, 2023. How can i market and campaign to get more daily users?
We are building a framework which will be used by other apps. Want to integrate crash reporting and diagnostics for our framework. Want to report crashes to our backend happening inside our framework only and ignore app level crashes. Is it possible to filter crashes like that ?
Hello,
It is mentioned in CryptoTokenKit documentation:
You use the CryptoTokenKit framework to easily access cryptographic tokens. Tokens are physical devices built in to the system, located on attached hardware (like a smart card), or accessible through a network connection.
However, it looks like there is lack of documentation with simple example, how to access network token.
I have a certificates in HSM (hardware secure module), which is accessible on network, and I'd like to access certificates on HSM on my Mac.
Does anybody know, where to start with implementation?
Thank you.
I have an image field on a Core Data entity with "Allows External Storage" enabled. When I delete a record, the external binary data file remains on disk. How can I ensure that all externally stored data is deleted along with the record?
Hi,
Overview
I am using Xcode Cloud for my multi platform app.
The macOS test case fails, however the iOS test case runs and succeeds.
I don't have any UI test cases written, the test case are simple and have nothing platform (macOS) specific.
Questions
What can I do to fix this?
Is there any user privileges needed to launch the macOS app for testing? I ask because when I ran the UI tests locally it launched the app and asked for my macOS user password. Just wondering if that is the reason it didn't launch in Xcode Cloud.
Error:
<Appname> encountered an error (Failed to install or launch the test runner. If you believe this error represents a bug, please attach the result bundle at /Volumes/workspace/resultbundle.xcresult.(Underlying Error: Could not launch "AppnameTests. The LaunchServices launcher has returned an error. Please check the system logs for
the underlying cause of the error. (Underlying Error: The operation couldn't be completed. Launch failed. (Underlying Error: Launch job spawn failed) )))
× Could not launch "<Appname>"
× Could not launch "AppnameTests"
× AppnameUITests.testExample()
Failed to get launch progress for <XCUIApplicationImpl: 0x600000564630 <BundleID> at /Volumes/workspace/TestProducts/Debug-Dev/<Appname>.app>: Could not launch "app name". The LaunchServices launcher has returned an error. Please check the system logs for the underlying cause of the error. (Underlying Error: The operation couldn't be completed. Launch failed. (Underlying Error: Launch job spawn failed))
AppnameUITests.swift:28
* AppnameUITests.testLaunchPerformance)
Failed to get launch progress for «XCUIApplicationimpl: 0x60000054630 <BundleID> at /Volumes/workspace/TestProducts/Debug-Dev/<Appname>.apps: Could not launch "<Appname>". The LaunchServices launcher has returned an error. Please check the system logs for the underlying cause of the error. (Underlying Error: The operation couldn't be completed. Launch failed. (Underlying Error: Launch job spawn failed))
AppnameUITests.swift:37 g
* AppnameUITestsLaunchTests.testLaunch)
Failed to get launch progress for «XCUIApplicationimpl: 0x60000054630 <BundleID> at /Volumes/workspace/Testroducts/Debug-Dev/<Appname>.apps: Could not launch "<Appname>". The LaunchServices launcher has returned an error. Please check the system logs for the underlying cause of the error. (Underlying Error: The operation couldn't be completed. Launch failed.
I'm trying to create a List that allows multiple selection. Each row can be edited but the issue is that since there's a tap gesture on the Text element, the list is unable to select the item.
Here's some code:
import SwiftUI
struct Person: Identifiable {
let id: UUID
let name: String
init(_ name: String) {
self.id = UUID()
self.name = name
}
}
struct ContentView: View {
@State private var persons = [Person("Peter"), Person("Jack"), Person("Sophia"), Person("Helen")]
@State private var selectedPersons = Set<Person.ID>()
var body: some View {
VStack {
List(selection: $selectedPersons) {
ForEach(persons) { person in
PersonView(person: person, selection: $selectedPersons) { newValue in
// ...
}
}
}
}
.padding()
}
}
struct PersonView: View {
var person: Person
@Binding var selection: Set<Person.ID>
var onCommit: (String) -> Void = { newValue in }
@State private var isEditing = false
@State private var newValue = ""
@FocusState private var isInputActive: Bool
var body: some View {
if isEditing {
TextField("", text: $newValue, onCommit: {
onCommit(newValue)
isEditing = false
})
.focused($isInputActive)
.labelsHidden()
}
else {
Text(person.name)
.onTapGesture {
if selection.contains(person.id), selection.count == 1 {
newValue = person.name
isEditing = true
isInputActive = true
}
}
}
}
}
Right now, you need to tap on the row anywhere but on the text to select it. Then, if you tap on the text it'll go in edit mode.
Is there a way to let the list do its selection? I tried wrapping the tap gesture in simultaneousGesture but that didn't work.
Thanks!
I have a very embarrassing problem. that I can't transfer my macOS app to another account. and above is wrong picture.
I already tried to delete the apps group. but it doesn't work.
this transfer is very important for our team. if anyone can tell me how to do, I will be very grateful.
, it is after update to Xcode 14.3:
[default] CGSWindowShmemCreateWithPort failed on port 0
We have noticed that in iOS 16 or greater , the Smart App Banner which shows based on meta tag added is not showing the app ratings inside the popup. Can we override this new behavior to show ratings and custom text.
Hi All!
I'm being asked to migrate an app which utilizes iCloud KVS (Key Value Storage). This ability is a new-ish feature, and the documentation about this is sparse [1]. Honestly, the entire documentation about the new iCloud transfer functionality seems to be missing. Same with Game Center / GameKit. While the docs say that it should work, I'd like to understand the process in more detail.
Has anyone migrated an iCloud KVS app? What happens after the transfer goes through, but before the first release? Do I need to do anything special? I see that the Entitlements file has the TeamID in the Key Value store - is that fine?
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>
Can someone please share their experience?
Thank you!
[1] https://developer.apple.com/help/app-store-connect/transfer-an-app/overview-of-app-transfer
I regularly see folks run into problems with their Developer ID signing identities. Historically I pointed them to my posts on this thread, but I’ve decided to collect these ideas together in one place.
If you have questions or comments, start a new thread here on DevForums and tag it with Developer ID so that I see it.
IMPORTANT Nothing I write here on DevForums is considered official documentation. It’s just my personal ramblings based on hard-won experience. There is a bunch of official documentation that covers the topics I touch on here, including:
Xcode documentation
Xcode Help
Developer Account Help
Developer > Support > Certificates
For a lot more information about code signing, see the Code Signing Resources pinned post.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
The Care and Feeding of Developer ID
Most Apple signing assets are replaceable. For example, if you accidentally lose access to your Apple Development signing identity, it’s a minor inconvenience. Just use the Developer website to revoke your previous certificate and create a replacement. Or have Xcode do that for you.
IMPORTANT If you don’t understand the difference between a certificate and a digital identity, and hence signing identity, read Certificate Signing Requests Explained before reading this post.
Some signing assets are precious. Losing access to such assets has significant consequences.
Foremost amongst those are Developer ID signing identities. These allow you to sign Mac products that ship independently. Anyone with access to your Developer ID signing identity can sign code as you. This has a number of consequences, both for you and for your relationship with Apple.
Identify a Developer ID Signing Identity
A Developer ID signing identity consists of two parts: the certificate and the private key. There are two different flavours, identifiable by the subject name in the certificate:
Developer ID Application — This is named Developer ID Application: TTT, where TTT identifies your team. Use this to sign code and disk images.
Developer ID Installer — This is named Developer ID Installer: TTT, where TTT identifies your team. Use this to sign installer packages.
Note If you do KEXT development, there’s a third flavour, namely a KEXT-enabled Developer ID Application signing identity. For more details, see KEXT Code Signing Problems.
This post focuses on traditional signing identities, where you manage the private key. Xcode Cloud introduced cloud signing, where signing identities are “stored securely in the cloud”. These identities have the Managed suffix in Certificates, Identifiers, and Profiles. For example, Developer ID Application Managed is the cloud signing equivalent of Developer ID Application. To learn more about cloud signing, watch WWDC 2021 Session 10204 Distribute apps in Xcode with cloud signing. To identify these certificates ‘in the wild’, see Identifying a Cloud Managed Signing Certificate.
Limit Access to Developer ID
Anyone with your Developer ID signing identity can sign code as you. Given that, be careful to limit access to these signing identities. This is true both for large organisations and small developers.
In a large organisation, ensure that only folks authorised to ship code on behalf of your organisation have access to your Developer ID signing identities. Most organisations have some sort of release process that they use to build, test, and authorise a release. This often involves a continuous integration (CI) system. Restrict CI access to only those folks involved in the release process.
Even if you’re a small developer with no formal release process, you can still take steps to restrict access to Developer ID signing identities. See Don’t Leak Your Private Key, below.
In all cases, don’t use your Developer ID signing identities for day-to-day development. That’s what Apple Development signing identities are for.
Create Developer ID Signing Identities as the Account Holder
Because Developer ID signing identities are precious, the Developer website will only let the Account Holder create them. For instructions on how to do this, see Developer Account Help > Create certificates > Create Developer ID certificates. For more information about programme roles, see Developer > Support > Program Roles.
IMPORTANT In an Organization team it’s common for the Account Holder to be non-technical. They may need help getting this done. For hints and tips on how to avoid problems while doing this, see Don’t Lose Your Private Key and Don’t Leak Your Private Key, both below.
Limit the Number of Developer ID Signing Identities You Create
Don’t create Developer ID signing identities unnecessarily. Most folks only need to create one. Well, one Developer ID Application and maybe one Developer ID Installer. A large organisation might need more, perhaps one for each sub-unit, but that’s it.
There are two reasons why this is important:
The more you have, the more likely it is for one to get into the wrong hands. Remember that anyone with your Developer ID signing identity can sign code as you.
The Developer website limits you to 5 Developer ID certificates.
Note I can never remember where this limit is actually documented, so here’s the exact quote from this page:
You can create up to five Developer ID Application certificates and up to five Developer ID Installer certificates using either your developer account or Xcode.
Don’t Lose Your Private Key
There are two standard processes for creating a Developer ID signing identity:
Developer website — See Developer Account Help > Create certificates > Create Developer ID certificates.
Xcode — See Xcode Help > Maintaining signing assets > Manage signing certificates.
Both processes implicitly create a private key in your login keychain. This makes it easy to lose your private key. For example:
If you do this on one Mac and then get a new Mac, you might forget to move the private key to the new Mac.
If you’re helping your Organization team’s Account Holder to create a Developer ID signing identity, you might forget to export the private key from their login keychain.
It also makes it easy to accidentally leave a copy of the private key on a machine that doesn’t need it; see Don’t Leak Your Private Key, below, for specific advice on that front.
Every time you create a Developer ID signing identity, it’s a good idea to make an independent backup of it. For advice on how to do that, see Back Up Your Signing Identities, below.
That technique is also useful if you need to copy the signing identity to a continuous integration system.
If you think you’ve lost the private key for a Developer ID signing identity, do a proper search for it. Finding it will save you a bunch of grief. You might be able to find it on your old Mac, in a backup, in a backup for your old Mac, and so on. For instructions on how to extract your private key from a general backup, see Recover a Signing Identity from a Mac Backup.
If you’re absolutely sure that you previous private key is lost, use the Developer website to create a replacement signing identity.
If the Developer website won’t let you create any more because you’ve hit the limit discussed above, talk to Developer Programs Support. Go to Apple > Developer > Contact Us and follow the path Development and Technical > Certificates, Identifiers, and Provisioning Profiles.
Don’t Leak Your Private Key
Anyone with your Developer ID signing identity can sign code as you. Thus, it’s important to take steps to prevent its private key from leaking.
A critical first step is to limit access to your Developer ID signing identities. For advice on that front, see Limit Access to Developer ID, above.
In an Organization team, only the Account Holder can create Developer ID signing identities. When they do this, a copy of the identity’s private key will most likely end up in their login keychain. Once you’ve exported the signing identity, and confirmed that everything is working, make sure to delete that copy of the private key.
Some organisations have specific rules for managing Developer ID signing identities. For example, an organisation might require that the private key be stored in a hardware token, which prevents it from being exported. Setting that up is a bit tricky, but it offers important security benefits.
Even without a hardware token, there are steps you can take to protect your Developer ID signing identity. For example, you might put it in a separate keychain, one with a different password and locking policy than your login keychain. That way signing code for distribution will prompt you to unlock the keychain, which reminds you that this is a significant event and ensures that you don’t do it accidentally.
If you believe that your private key has been compromised, follow the instructions in the Compromised Certificates section of Developer > Support > Certificates.
IMPORTANT Don’t go down this path if you’ve simply lost your private key.
Back Up Your Signing Identities
Given that Developer ID signing identities are precious, consider making an independent backup of them. To back up a signing identity to a PKCS#12 (.p12) file:
Launch Keychain Access.
At the top, select My Certificates.
On the left, select the keychain you use for signing identities. For most folks this is the login keychain.
Select the identity.
Choose File > Export Items.
In the file dialog, select Personal Information Exchange (.p12) in the File Format popup.
Enter a name, navigate to your preferred location, and click Save.
You might be prompted to enter the keychain password. If so, do that and click OK.
You will be prompted to enter a password to protect the identity. Use a strong password and save this securely in a password manager, corporate password store, on a piece of paper in a safe, or whatever.
You might be prompted to enter the keychain password again. If so, do that and click Allow.
The end result is a .p12 file holding your signing identity. Save that file in a secure location, and make sure that you have a way to connect it to the password you saved in step 9.
Remember to backup all your Developer ID signing identities, including the Developer ID Installer one if you created it.
To restore a signing identity from a backup:
Launch Keychain Access.
Choose File > Import Items.
In the open sheet, click Show Options.
Use the Destination Keychain popup to select the target keychain.
Navigate to and select the .p12 file, and then click Open.
Enter the .p12 file’s password and click OK.
If prompted, enter the destination keychain password and click OK.
Alternatively, Xcode has a feature to export and import your developer account, including your Developer ID signing identities. Do this using the action menu in Xcode > Settings > Accounts. For the details, see Xcode Help > Maintaining signing assets > Export signing certificates and provisioning profiles.
Recover a Signing Identity from a Mac Backup
If you didn’t independently backup your Developer ID signing identity, you may still be able to recover it from a general backup of your Mac. To start, work out roughly when you created your Developer ID signing identity:
Download your Developer ID certificate from the Developer website.
In the Finder, Quick Look it.
The Not Valid Before field is the date you’re looking for.
Now it’s time to look in your backups. The exact details depend on the backup software you’re using, but the basic process runs something like this:
Look for a backup taken shortly after the date you determined above.
In that backup, look for the file ~/Library/Keychains/login.keychain.
Recover that to a convenient location, like your desktop. Don’t put it in ~/Library/Keychains because that’ll just confuse things.
Rename it to something unique, like login-YYYY-MM-DD.keychain, where YYYY-MM-DD is the date of the backup.
In Keychain Access, choose File > Add Keychain and, in the resulting standard file panel, choose that .keychain file.
On the left, select login-YYYY-MM-DD.
Chose File > Unlock Keychain “login-YYYY-MM-DD“.
In the resulting password dialog, enter your login password at the date of the backup.
At the top, select My Certificates.
Look through the list of digital identities to find the Developer ID identity you want. If you don’t see the one you’re looking for, see Further Recovery Tips below.
Export it using the process described at the start of Back Up Your Signing Identities.
Once you’re done, remove the keychain from Keychain Access:
On the left, select the login-YYYY-MM-DD keychain.
Choose File > Delete Keychain “login-YYYY-MM-DD”.
In the confirmation alert, click Remove Reference.
The login-YYYY-MM-DD.keychain is now just a file. You can trash it, keep it, whatever, at your discretion.
This process creates a .p12 file. To work with that, import it into your keychain using the process described at the end of Back Up Your Signing Identities.
IMPORTANT Keep that .p12 file as your own independent backup of your signing identity.
Further Recovery Tips
If, in the previous section, you can’t find the Developer ID identity you want, there are a few things you might do:
Look in a different backup.
If your account has more than one keychain, look in your other keychains.
If you have more than one login account, look at the keychains for your other accounts.
If you have more than one Mac, look at the backups for your other Macs.
The login-YYYY-MM-DD keychain might have the private key but not the certificate. Add your Developer ID certificate to that keychain to see if it pairs with a private key.
Revision History
2025-02-20 Added some clarification to the end of Don’t Leak Your Private Key.
2023-10-05 Added the Recover a Signing Identity from a Mac Backup and Further Recovery Tips sections.
2023-06-23 Added a link to Identifying a Cloud Managed Signing Certificate.
2023-06-21 First posted.
I am trying to do a mass enablement of a merchant ids for a psp.
The ids have been approved by apple. I am attempting to add more using the Post Request: https://apple-pay-gateway.apple.com/paymentservices/registerMerchant
(https://developer.apple.com/documentation/applepaywebmerchantregistrationapi/register_merchant) but am always getting a Refuse to connect error.
What authentication is required to get a 200 successful response?