You can now easily request access to managed capabilities for your App IDs directly from the new Capability Requests tab in Certificates, Identifiers & Profiles > Identifiers. With this update, view available capabilities in one convenient location, check the status of your requested capabilities, and see any notes from Apple related to your requests. Learn more about capability requests.
Demystify code signing and its importance in app development. Get help troubleshooting code signing issues and ensure your app is properly signed for distribution.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
General:
Forums topic: Code Signing
Forums subtopics: Code Signing > General, Code Signing > Certificates, Identifiers & Profiles, Code Signing > Notarization, Code Signing > Entitlements
Forums tags: Code Signing, Signing Certificates, Provisioning Profiles, Entitlements
Developer Account Help — This document is good in general but, in particular, the Reference section is chock-full of useful information, including the names and purposes of all certificate types issued by Apple Developer web site, tables of which capabilities are supported by which distribution models on iOS and macOS, and information on how to use managed capabilities.
Developer > Support > Certificates covers some important policy issues
Bundle Resources > Entitlements documentation
TN3125 Inside Code Signing: Provisioning Profiles — This includes links to the other technotes in the Inside Code Signing series.
WWDC 2021 Session 10204 Distribute apps in Xcode with cloud signing
Certificate Signing Requests Explained forums post
--deep Considered Harmful forums post
Don’t Run App Store Distribution-Signed Code forums post
Resolving errSecInternalComponent errors during code signing forums post
Finding a Capability’s Distribution Restrictions forums post
Signing code with a hardware-based code-signing identity forums post
New Capabilities Request Tab in Certificates, Identifiers & Profiles forums post
Isolating Code Signing Problems from Build Problems forums post
Investigating Third-Party IDE Code-Signing Problems forums post
Determining if an entitlement is real forums post
Mac code signing:
Forums tag: Developer ID
Creating distribution-signed code for macOS documentation
Packaging Mac software for distribution documentation
Placing Content in a Bundle documentation
Embedding nonstandard code structures in a bundle documentation
Embedding a command-line tool in a sandboxed app documentation
Signing a daemon with a restricted entitlement documentation
Defining launch environment and library constraints documentation
WWDC 2023 Session 10266 Protect your Mac app with environment constraints
TN2206 macOS Code Signing In Depth archived technote — This doc has mostly been replaced by the other resources linked to here but it still contains a few unique tidbits and it’s a great historical reference.
Manual Code Signing Example forums post
The Care and Feeding of Developer ID forums post
TestFlight, Provisioning Profiles, and the Mac App Store forums post
For problems with notarisation, see Notarisation Resources. For problems with the trusted execution system, including Gatekeeper, see Trusted Execution Resources.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Topic:
Code Signing
SubTopic:
General
Tags:
Entitlements
Code Signing
Provisioning Profiles
Signing Certificates
I am developing and distributing an XCFramework, and I want to ensure that it remains valid for as long as possible. I have some questions regarding certificate expiration and revocation:
I understand that if an XCFramework is signed with a timestamp, it remains valid even after the signing certificate expires.
However, if the signing certificate is revoked, the XCFramework immediately becomes unusable.
As far as I know, Apple allows a maximum of two active distribution certificates at the same time.
I assume that once a certificate expires, it will eventually need to be revoked in order to issue a third certificate. Is this correct?
If an expired certificate is later revoked, will the XCFrameworks signed with that certificate also become invalid, even though they were timestamped?
I want to ensure that released XCFrameworks remain valid for as long as possible. What is the best approach to achieve this?
If anyone has insights or official documentation references on how to manage signing certificates for long-term XCFramework validity, I would appreciate your guidance.
Thank you!
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles
Tags:
Frameworks
Signing Certificates
Code Signing
This issue keeps cropping up on the forums and so I decided to write up a single post with all the details. If you have questions or comments:
If you were referred here from an existing thread, reply on that thread.
If not, feel free to start a new thread. Use whatever topic and subtopic is appropriate for your question, but also add the Entitlements tag so that I see it.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Determining if an entitlement is real
In recent months there’s been a spate of forums threads involving ‘hallucinated’ entitlements. This typically pans out as follows:
The developer, or an agent working on behalf of the developer, changes their .entitlements file to claim an entitlement that’s not real. That is, the entitlement key is a value that is not, and never has been, supported in any way.
Xcode’s code signing machinery tries to find or create a provisioning profile to authorise this claim.
That’s impossible, because the entitlement isn’t a real entitlement. Xcode reports this as a code signing error.
The developer misinterprets that error [1] in one of two ways:
As a generic Xcode code signing failure, and so they start a forums thread asking about how to fix that problem.
As an indication that the entitlement is managed — that is, requires authorisation from Apple to use — and so they start a forums thread asking how to request such authorisation.
The fundamental problem is step 1. Once you start claiming entitlements that aren’t real, you’re on a path to confusion.
Note If you’re curious about how provisioning profiles authorise entitlement claims, read TN3125 Inside Code Signing: Provisioning Profiles.
There are a couple of ways to check whether an entitlement is real. My preferred option is to create a new test project and use Xcode’s Signing & Capabilities editor to add the corresponding capability to it. Then look at what Xcode did. You might find that Xcode claimed a different entitlement, or added an Info.plist key, or did nothing at all.
IMPORTANT If you can’t find the correct capability in the Signing & Capabilities editor, it’s likely that this feature is available to all apps, that is, it’s not gated by an entitlement or anything else.
Another thing you can do is search the documentation. The vast majority of real entitlements are documented in Bundle Resources > Entitlements.
IMPORTANT When you search for documentation, focus on the Apple documentation. If, for example, you search the Apple Developer Forums, you might be mislead by other folks who are similarly confused.
If you find that you’re mistakenly trying to claim a hallucinated entitlement, the fix is trivial:
Remove it from your .entitlements file so that your app starts to build again.
Then add the capability using Xcode’s Signing & Capabilities editor. This will do the right thing.
If you continue to have problems, feel free to ask for help here on the forums. See the top of this post for advice on how to do that.
[1] Xcode 26.2, currently being seeded as Release Candidate, is much better about this (r. 155327166). Give it a whirl!
Commonly Hallucinated Entitlements
This section lists some of the more commonly hallucinated entitlements:
com.apple.developer.push-notifications — The correct entitlement is aps-environment (com.apple.developer.aps-environment on macOS), documented here. There’s also the remote-notification value in the UIBackgroundModes property.
com.apple.developer.in-app-purchase — There’s no entitlement for in-app purchase. Rather, in-app purchase is available to all apps with an explicit App ID (as opposed to a wildcard App ID).
com.apple.InAppPurchase — Likewise.
com.apple.developer.storekit — Likewise.
com.apple.developer.in-app-purchase.non-consumable — Likewise.
com.apple.developer.in-app-purchase.subscription — Likewise.
com.apple.developer.app-groups — The correct entitlement is com.apple.security.application-groups, documented here. And if you’re working on the Mac, see App Groups: macOS vs iOS: Working Towards Harmony.
com.apple.developer.background-modes — Background modes are controlled by the UIBackgroundModes key in your Info.plist, documented here.
UIBackgroundModes — See the previous point.
com.apple.developer.voip-push-notification — There’s no entitlement for this. VoIP is gated by the voip value in the UIBackgroundModes property.
com.apple.developer.family-controls.user-authorization — The correct entitlement is com.apple.developer.family-controls, documented here.
IMPORTANT As explained in the docs, this entitlement is available to all developers during development but you must request authorisation for distribution.
com.apple.developer.device-activity — The DeviceActivity framework has the same restrictions as Family Controls.
com.apple.developer.managed-settings — If you’re trying to use the ManagedSettings framework, that has the same restrictions as Family Controls. If you’re trying to use the ManagedApp framework, that’s not gated by an entitlement.
com.apple.developer.callkit.call-directory — There’s no entitlement for the Call Directory app extension feature.
com.apple.developer.nearby-interaction — There’s no entitlement for the Nearby interaction framework.
com.apple.developer.secure-enclave — On iOS and its child platforms, there’s no entitlement required to use the Secure Enclave. For macOS specifically, any program that has access to the data protection keychain also has access to the Secure Enclave [1]. See TN3137 On Mac keychain APIs and implementations for more about the data protection keychain.
com.apple.developer.networking.configuration — If you’re trying to configure the Wi-Fi network on iOS, the correct entitlement is com.apple.developer.networking.HotspotConfiguration, documented here.
com.apple.developer.musickit — There is no MusicKit capability. Rather, enable MusicKit via the App Services column in the App ID editor, accessible from Developer > Certificates, Identifiers, and Profiles > Identifiers.
com.apple.mail.extension — Creating an app extension based on the MailKit framework does not require any specific entitlement.
com.apple.security.accessibility — There’s no entitlement that gates access to the Accessibility APIs on macOS. Rather, this is controlled by the user in System Settings > Privacy & Security. Note that sandboxed apps can’t use these APIs. See the Review functionality that is incompatible with App Sandbox section of Protecting user data with App Sandbox.
com.apple.developer.adservices — Using the AdServices framework does not require any specific entitlement.
[1] While technically these are different features, they are closely associated and it turns out that, if you have access to the data protection keychain, you also have access to the SE.
Revision History
2025-12-09 Updated the Xcode footnote to mention the improvements in Xcode 26.2rc.
2025-11-03 Added com.apple.developer.adservices to the common hallucinations list.
2025-10-30 Added com.apple.security.accessibility to the common hallucinations list.
2025-10-22 Added com.apple.mail.extension to the common hallucinations list. Also added two new in-app purchase hallucinations.
2025-09-26 Added com.apple.developer.musickit to the common hallucinations list.
2025-09-22 Added com.apple.developer.storekit to the common hallucinations list.
2025-09-05 Added com.apple.developer.device-activity to the common hallucinations list.
2025-09-02 First posted.
Since around September (iOS 26 release), i'm unable to test my app normally. It says "internet connection is required to verify [my certificate id]", or just crashing. All terms and conditions accepted, everything is valid, certificates are OK.
Reinstallation via xcode does not help. Removal of provisioning profile, generating new does not help. Revoking of certificate and generating new does for around week, then it happens again, but do i need to do it every week now?
In logs i see the following:
default amfid validation failed because of missing trust and/or authorization (0xe8008026)
error amfid not valid: 0xe8008026: The provisioning profile requires online authorization.
error amfid Unexpected MISError (0xe8008026): The provisioning profile requires online authorization.
default +0300 amfid /private/var/containers/Bundle/Application/5B8E560E-75B2-46EF-8606-02072D99E9CF//Frameworks/oss.dylib not valid: Error Domain=AppleMobileFileIntegrityError Code=-400 "An unknown error was encountered" UserInfo={NSURL=file:///private/var/containers/Bundle/Application/5B8E560E-75B2-46EF-8606-02072D99E9CF//Frameworks/oss.dylib, NSLocalizedDescription=An unknown error was encountered}
default kernel AMFI: code signature validation failed.
It looks like apple validation servers are not working, or is it iOS bug? All provisioning profiles are showing like "valid" in apple developer center.
My network is not behind a proxy, connection is direct.
If use EXACTLY the same app, signed with the same provisioning, same signature, on another test device, it works!
When i reset current device to default settings and installing the EXACTLY same app after it, it works as well.
Looking for a help from apple developer support
I tried to create a new IOS provisioning profile and re-apply it to the app using Xcode to build it, but I got into trouble.
The build is good, but it bounces when running the app.
I would appreciate it if you could let me know what to do.
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles
note technically code-signing but related......
Why has there been no update to the documentation at:
https://developer.apple.com/documentation/appstorereceipts/validating_receipts_on_the_device
To demonstrate how to validate an SHA256 app store hash ???
The January deadline is looming and I can find no working example code which sucessfully validates an SHA256 hash
HELP !!!!
Topic:
Code Signing
SubTopic:
General
The product archive package's signature is invalid. Ensure that it is signed with your "3rd Party Mac Developer Installer" certificate. (90237)
I'm receiving this error, despite the fact that I'm using this certificate when creating the pkg (with electron-forge)
My configuration is shown below - note the 3rd Party Mac Developer Installer identity when using new MakerPKG.
const config: ForgeConfig = {
packagerConfig: {
asar: true,
name: 'Deep Focus',
icon: 'resources/icon.icns',
osxSign: {
identity: 'Apple Distribution: Timeo Williams (3Y4F3KTSJA)',
type: 'distribution',
provisioningProfile: '/Users/timeo/Desktop/Deep Focus/deepWork/distribution.provisionprofile',
preAutoEntitlements: false,
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
optionsForFile() {
return {
entitlements: 'build/entitlements.mas.plist'
}
}
},
extendInfo: 'build/info.plist',
osxUniversal: {
mergeASARs: true
},
appCategoryType: 'public.app-category.productivity',
appBundleId: 'com.electron.deepfocus',
extraResource: [
'resources/.env',
'resources/icon.icns',
]
},
rebuildConfig: {},
makers: [
new MakerSquirrel({}),
new MakerZIP({}),
new MakerRpm({}),
new MakerDeb({}),
new MakerDMG({
appPath: './out/Deep Focus-darwin-arm64/Deep Focus.app',
name: 'Deep Focus',
icon: './resources/icon.icns',
format: 'ULFO',
overwrite: true,
contents: (opts) => [
{ x: 130, y: 220, type: 'file', path: opts.appPath },
{ x: 410, y: 220, type: 'link', path: '/Applications' }
]
}),
new MakerPKG({
name: 'Deep Focus',
identity: '3rd Party Mac Developer Installer: Timeo Williams (3Y4F3KTSJA)'
})
],
plugins: [
new VitePlugin({
build: [
{
entry: 'src/main.ts',
config: 'vite.main.config.ts',
target: 'main'
},
{
entry: 'src/preload.ts',
config: 'vite.preload.config.ts',
target: 'preload'
}
],
renderer: [
{
name: 'main_window',
config: 'vite.renderer.config.mts' // Path to Vite config for renderer process
}
]
}),
new FusesPlugin({
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false,
[FuseV1Options.EnableCookieEncryption]: true,
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
[FuseV1Options.OnlyLoadAppFromAsar]: true
})
]
}
Yet, I'm getting the error from Transporter that it's invalid?
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles
Tags:
Universal Apps
Entitlements
App Store Connect
macOS
The notary service requires that all Mach-O images be linked against the macOS 10.9 SDK or later. This isn’t an arbitrary limitation. The hardened runtime, another notarisation requirement, relies on code signing features that were introduced along with macOS 10.9 and it uses the SDK version to check for their presence. Specifically, it checks the SDK version using the sdk field in the LC_BUILD_VERSION Mach-O load command (or the older LC_VERSION_MIN_MACOSX command).
There are three common symptoms of this problem:
When notarising your product, the notary service rejects a Mach-O image with the error The binary uses an SDK older than the 10.9 SDK.
When loading a dynamic library, the system fails with the error mapped file has no cdhash, completely unsigned?.
When displaying the code signature of a library, codesign prints this warning:
% codesign -d vvv /path/to/your.dylib
…
Library validation warning=OS X SDK version before 10.9 does not support Library Validation
…
If you see any of these errors, read on…
The best way to avoid this problem is to rebuild your code with modern tools. However, in some cases that’s not possible. Imagine if your app relies on the closed source libDodo.dylib library. That library’s vendor went out of business 10 years ago, and so the library hasn’t been updated since then. Indeed, the library was linked against the macOS 10.6 SDK. What can you do?
The first thing to do is come up with a medium-term plan for breaking your dependency on libDodo.dylib. Relying on an unmaintained library is not something that’s sustainable in the long term. The history of the Mac is one of architecture transitions — 68K to PowerPC to Intel, 32- to 64-bit, and so on — and this unmaintained library will make it much harder to deal with the next transition.
IMPORTANT I wrote the above prior to the announcement of the latest Apple architecture transition, Apple silicon. When you update your product to a universal binary, you might as well fix this problem on the Intel side as well. Do not delay that any further: While Apple silicon Macs are currently able to run Intel code using Rosetta 2, that’s not something you want to rely on in the long term. Heed this advice from About the Rosetta Translation Environment:
Rosetta is meant to ease the transition to Apple silicon, giving you
time to create a universal binary for your app. It is not a substitute
for creating a native version of your app.
But what about the short term? Historically I wasn’t able to offer any help on that front, but this has changed recently. Xcode 11 ships with a command-line tool, vtool, that can change the LC_BUILD_VERSION and LC_VERSION_MIN_MACOSX commands in a Mach-O. You can use this to change the sdk field of these commands, and thus make your Mach-O image ‘compatible’ with notarisation and the hardened runtime.
Before doing this, consider these caveats:
Any given Mach-O image has only a limited amount of space for load commands. When you use vtool to set or modify the SDK version, the Mach-O could run out of load command space. The tool will fail cleanly in this case but, if it that happens, this technique simply won’t work.
Changing a Mach-O image’s load commands will break the seal on its code signature. If the image is signed, remove the signature before doing that. To do this run codesign with the --remove-signature argument. You must then re-sign the library as part of your normal development and distribution process.
Remember that a Mach-O image might contain multiple architectures. All of the tools discussed here have an option to work with a specific architecture (usually -arch or --architecture). Keep in mind, however, that macOS 10.7 and later do not run on 32-bit Macs, so if your deployment target is 10.7 or later then it’s safe to drop any 32-bit code. If you’re dealing with a Mach-O image that includes 32-bit Intel code, or indeed PowerPC code, make your life simpler by removing it from the image. Use lipo for this; see its man page for details.
It’s possible that changing a Mach-O image’s SDK version could break something. Indeed, many system components use the main executable’s SDK version as part of their backwards compatibility story. If you change a main executable’s SDK version, you might run into hard-to-debug compatibility problems. Test such a change extensively.
It’s also possible, but much less likely, that changing the SDK version of a non-main executable Mach-O image might break something. Again, this is something you should test extensively.
This list of caveats should make it clear that this is a technique of last resort. I strongly recommend that you build your code with modern tools, and work with your vendors to ensure that they do the same. Only use this technique as part of a short-term compatibility measure while you implement a proper solution in the medium term.
For more details on vtool, read its man page. Also familiarise yourself with otool, and specifically the -l option which dumps a Mach-O image’s load commands. Read its man page for details.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Revision history:
2025-04-03 — Added a discussion of common symptoms. Made other minor editorial changes.
2022-05-09 — Updated with a note about Apple silicon.
2020-09-11 — First posted.
i was complete my program, and export a mac app already
it work ok in my macmini, but if i want send it to app store, that i have no way now
i still do not know how to make this app perfect
like, when i use pyinstaller to build this app, is there any info or elements need make with?
i can sign my app now, even i use codesign -dvvv my.app to check the sign, it is also ok, there no any feedback said it anything wrong.
so, any master know fix app sign or any infoplist please tech me... help
Topic:
Code Signing
SubTopic:
Certificates, Identifiers & Profiles
I have 14 total devices, from way back. I am currently in a financial bind and can't renew just yet. BUT I am at past my time to reset the device list back to zero.
But the screen to do that is behind the paid account. Catch 22
Can we fix it?
As it stands I must email tech support, but this is a bug so I posted
IMPORTANT The underlying issue here (FB8830007) was fixed in macOS 11.3, so the advice in this post is irrelevant if you’re building on that release or later.
Note This content is a repost of info from another thread because that thread is not world readable (it’s tied to the DTK programme).
A number of folks have reported problems where:
They have a product that supports older versions of macOS (anything prior to 10.11).
If they build their product on Intel, everything works.
If they build their product on Apple Silicon, it fails on those older versions of macOS.
A developer filed a bug about this (FB8830007) and, based on the diagnosis of that bug, I have some info to share as to what’s going wrong and how you can prevent it. Let’s start with some background.
macOS’s code signing architecture supports two different hash formats:
sha1, the original hash format, which is now deprecated
sha256, the new format, support for which was added in macOS 10.11
codesign should choose the signing format based on the deployment target:
If your deployment target is 10.11 or later, you get sha256.
If your deployment target is earlier, you get both sha1 and sha256.
This problem crops up because, when building for both Intel and Apple Silicon, your deployment targets are different. You might set the deployment target to 10.9 but, on Apple Silicon, that’s raised to the minimum Apple Silicon system, 11.0. So, which deployment target does it choose?
Well, the full answer to that is complex but the executive summary is that it chooses the deployment target of the current architecture, that is, Intel if you’re building on Intel and Apple Silicon if you’re building on Apple Silicon. For example:
intel% codesign -d --arch x86_64 -vvv Test664892.app
…
Hash choices=sha1,sha256
…
intel% codesign -d --arch arm64 -vvv Test664892.app
…
Hash choices=sha1,sha256
…
arm% codesign -d --arch x86_64 -vvv Test664892.app
…
Hash choices=sha256
…
arm% codesign -d --arch arm64 -vvv Test664892.app
…
Hash choices=sha256
…
The upshot is that you have problems if your deployment target is less than 10.11 and you sign on Apple Silicon. When you run on, say, macOS 10.10, the system looks for a sha1 hash, doesn’t find it, and complains.
The workaround is to supply the --digest-algorithm=sha1,sha256, which overrides the hash choice logic in codesign and causes it to include both hashes:
arm% codesign -s - --digest-algorithm=sha1,sha256 Test664892.app
arm% codesign -d --arch x86_64 -vvv Test664892.app
…
Hash choices=sha1,sha256
…
% codesign -d --arch arm64 -vvv Test664892.app
…
Hash choices=sha1,sha256
…
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
I am writing to follow up on my request for Family Control permission, which I submitted through the appropriate form over a week ago.
Unfortunately, I have not yet received any response or access to the requested permissions. Could you kindly provide an update on the status of my request? If any further information or action is needed from my end, please let me know.
Xcode 16.2 無法在IOS 18.2 Debug
Xcode 16.2
iOS 18.2
直接建立新專案
Xcode -> Create New Project -> Multiplatform -> Application -> App
選擇 實體手機 -> 執行
error: attach by pid '1050' failed -- attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)
Logging Error: Failed to initialize logging system due to time out. Log messages may be missing. If this issue persists, try setting IDEPreferLogStreaming=YES in the active scheme actions environment variables.
Even if I recreate everything and register it, it does not register in xcode as shown below. No matter how many times I regenerate the certificate and profile, the same thing happens.
We notarize all of our apps as part of our nightly build. Every few weeks Apple changes something in the developer agreement, and therefore require the primary account holder to accept the new terms. However, this means our nightly builds break until the terms are accepted, which is a true pain in the ass. Is there some way to tell notarytool to force the notarization? Or tell the lawyers to chill tf out? This seems to happen every 2-4 weeks.
Topic:
Code Signing
SubTopic:
Notarization
I am reaching out regarding a persistent issue I have been facing with code signing. Despite extensive troubleshooting, I am unable to resolve the problem, and I would greatly appreciate your assistance.
When attempting to sign my electron application with codesign with the following command:
codesign --keychain ~/Library/Keychains/login.keychain --sign “Developer ID Application: MYNAME (DEV-ID)” --force --timestamp --options runtime --verbose=4 dist/mac-arm64/my.app
I receive the following error message:
“Warning: unable to build chain to self-signed root for signer ‘Developer ID Application: MYNAME (DEV-ID)‘“.
This prevents me from successfully completing the code signing and notarization process.
To resolve this, I have meticulously tried to troubleshoot the problem. Here are the steps taken so far:
Imported Certificates into Keychains:
I imported all necessary certificates (including Developer ID Application, Developer ID Certification Authority, Apple Root CA and Apple Root CA - G2) into the keychain.
I tested with both the System and Login keychains (one at a time to avoid errors due to duplicates)
Checked Trust Settings:
I confirmed that the trust settings for the certificates are properly configured to “Always Trust.”
I verified the private key is present in Keychain Access and is properly linked to the public certificate.
Ensured valid identity:
I ensured that the correct Developer ID identity is valid and the associated private key is available (security find-identity -v -p codesigning and security find-key -t private | grep “MY NAME”)
Ensured keychain access permissions:
I ensured that the respective keychain has access permissions (security set-key-partition-list -S apple-tool:,apple: -s -k ~/Library/Keychains/login.keychain)
Verified matching Issuer and Subject to build certificate chain:
I verified that the Issuer and Subject fields in the certificates show the correct references to build the certificate chain.
Deleted and Re-imported Certificates:
I deleted and re-imported the certificates multiple times to ensure there were no import issues or corruption in the certificates.
Tested simplified setup:
I attempted to sign simple files, such as a plain .txt file, using the Developer ID Application certificate
I also attempted signing with minimal flags to rule out any issues with the app structure or build configuration
Updated Xcode Command Line Tools
One potential factor is that I am signing the application on a different machine from the one where the certificates were originally generated. I included the private key when exporting the certificate as a .p12 file from the original computer and imported it into the second computer’s keychain. This second computer is not connected to iCloud, and I suspect this could potentially affect the signing process.
Despite all these efforts, the issue persists, and I am unable to identify the root cause. I would greatly appreciate your guidance on resolving this matter so I can successfully complete the code signing and notarization process.
Thank you for your time and support.
Topic:
Code Signing
SubTopic:
Notarization
From time to time I see folks run into error 65 when stapling a ticket to their notarised Mac software. This post explains the two common causes of that error.
If you have questions or comments, start a new thread here on the forums. Put it in the Code Signing > Notarization topic area so that I see it.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
Resolving Error 65 When Stapling
If you directly distribute Mac software, you must sign and notarise your product so that it passes Gatekeeper. For information on how to do this, see:
Notarizing macOS software before distribution, if you use Xcode
Creating distribution-signed code for macOS, Packaging Mac software for distribution, and Customizing the notarization workflow otherwise
The last step of that process is to staple a ticket to your notarised product. This can fail with error 65. There are two common causes of that failure:
No appropriate ticket
Trust issues
The following sections explain how to recognise and resolve these issues.
Note You are not absolutely required to staple your product. See The Pros and Cons of Stapling for more on that topic.
No Appropriate Ticket
Consider the following stapling error:
% stapler staple "TestError65.dmg"
Processing: /Users/quinn/Desktop/TestError65 2025-03-03 22-12-47/TestError65.dmg
CloudKit query for TestError65.dmg (2/d812985247c75e94fd603f026991f96144a031af) failed due to "Record not found".
Could not find base64 encoded ticket in response for 2/d812985247c75e94fd603f026991f96144a031af
The staple and validate action failed! Error 65.
Note the Record not found message. This indicates that the stapling operation failed because there’s no appropriate ticket.
To investigate this, look at the notary log:
% notarytool-log b53042b6-4cbb-4cef-ade4-dae034a69947
{
…
"status": "Accepted",
…
"sha256": "f012735a6d53b17082c088627da4249c9988111d17e7a90c49aa64ebc6bae22e",
"ticketContents": [
{
"path": "TestError65.dmg/TestError65.app",
"digestAlgorithm": "SHA-256",
"cdhash": "abc27b0f2daee77b9316de3c6844fbd9e234621c",
"arch": "x86_64"
},
{
"path": "TestError65.dmg/TestError65.app",
"digestAlgorithm": "SHA-256",
"cdhash": "9627c72e53d44ae77513613e2ce33314bd5ef41e",
"arch": "arm64"
},
{
"path": "TestError65.dmg/TestError65.app/Contents/MacOS/TestError65",
"digestAlgorithm": "SHA-256",
"cdhash": "abc27b0f2daee77b9316de3c6844fbd9e234621c",
"arch": "x86_64"
},
{
"path": "TestError65.dmg/TestError65.app/Contents/MacOS/TestError65",
"digestAlgorithm": "SHA-256",
"cdhash": "9627c72e53d44ae77513613e2ce33314bd5ef41e",
"arch": "arm64"
},
{
"path": "TestError65.dmg",
"digestAlgorithm": "SHA-256",
"cdhash": "01a553c91ee389764971767f5082ab8c7dcece02"
}
],
"issues": null
}
First, make sure that the status field is Accepted. If there’s some other value, the notary service didn’t generate a ticket at all! To understand why, look at the rest of the notary log for errors and warnings.
Assuming that your notarisation request was successful, look through the log for cdhash values. These represent the contents of the ticket generated by the notary service. Compare that list to the cdhash values of the code being signed:
% hdiutil attach "TestError65.dmg"
…
… /Volumes/Install TestError65
% codesign -d -vvv --arch arm64 "/Volumes/Install TestError65/TestError65.app"
…
CDHash=9627c72e53d44ae77513613e2ce33314bd5ef41e
…
% codesign -d -vvv --arch x86_64 "/Volumes/Install TestError65/TestError65.app"
…
CDHash=abc27b0f2daee77b9316de3c6844fbd9e234621c
…
Those are all present in the ticket. However, consider the cdhash of the disk image itself:
% codesign -d -vvv "TestError65.dmg"
…
CDHash=d812985247c75e94fd603f026991f96144a031af
…
That’s the cdhash that stapler is looking for:
CloudKit query for TestError65.dmg (2/d812985247c75e94fd603f026991f96144a031af) failed due to "Record not found".
But it’s not present in the notarised ticket.
Note The term cdhash stands for code directory hash. If you’re curious what that’s about, see TN3126 Inside Code Signing: Hashes and the Notarisation Fundamentals DevForums post.
What happened here is:
I built the app.
I signed it with my Developer ID code-signing identity.
I created a disk image from that app.
I signed that with my Developer ID code-signing identity.
I notarised that.
I then re-signed the disk image. This changes the cdhash in the code signature.
Now the disk image’s cdhash doesn’t match the cdhash in the ticket, so stapling fails.
To resolve this problem, make sure you’re stapling exactly the file that you submitted to the notary service. One good option is to compare the SHA-256 hash of the file you’re working on with the sha256 field in the notary log.
Trust Issues
Now consider this stapling error:
% stapler staple "TestError65.dmg"
Processing: /Users/quinn/TestError65.dmg
Could not validate ticket for /Users/quinn/TestError65.dmg
The staple and validate action failed! Error 65.
Note how it’s different from the previous one. Rather than saying that the ticket was not found, it says Could not validate ticket. So, stapler found the ticket for the file and then tried to validate it before doing the staple operation. That validation failed, and thus this error.
The most common cause of this problem is folks messing around with trust settings. Consider this:
% security dump-trust-settings
SecTrustSettingsCopyCertificates: No Trust Settings were found.
% security dump-trust-settings -d
SecTrustSettingsCopyCertificates: No Trust Settings were found.
Contrast it with this:
% security dump-trust-settings
SecTrustSettingsCopyCertificates: No Trust Settings were found.
% security dump-trust-settings -d
Number of trusted certs = 1
Cert 0: Apple Root CA - G3
Number of trust settings : 10
…
Someone has tweaked the trust settings for the Apple Root CA - G3 anchor. In fact, I used Keychain Access to mark the certificate as Always Trust. You’d think that’d avoid problems, but you’d be wrong. Our code signing machinery expects Apple’s anchor and intermediate certificates to have the default trust settings.
IMPORTANT Some trust settings overrides are fine. For example, on my main work Mac there are trust settings overrides for Apple internal anchors. This problem occurs when there are trust settings overrides for Apple’s standard anchor and intermediate certificates.
To fix this:
In Terminal, run the dump-trust-settings commands shown above and build a list of Apple certificates with trust settings overrides.
In Keychain Access, find the first problematic certificate in your list.
Note that there may be multiple instances of the certificate in different keychains. If that’s the case, follow these steps for each copy of the certificate.
Double click the certificate to open it in a window.
If the Trust section is collapsed, expand it.
Ensure that all the popups are set to their default values (Use System Defaults for the first, “no value specified” for the rest).
If they are, close the window and move on to step 8.
If not, set the popups to the default values and close the window. Closing the window may require authentication to save the trust settings.
Repeat steps until 2 through 7 for each of the problematic certificates you found in step 1.
When you’re done, run the dump-trust-settings commands again to confirm that your changes took effect.
I am distributing a macOS application outside the App Store using Developer ID and need to provide provisioning profiles to customers for installation during the package installation process.
I have two questions:
How can I package and provide the provisioning profile(s) so that the customer can install them easily during the application installation process? Are there any best practices or tools that could simplify this step?
In my case, there are multiple provisioning profiles. Should I instruct the customer to install each profile individually, or is there a way to combine them and have them installed all at once?
Any guidance on the best practices for this process would be greatly appreciated.
Hi All,
Like many others I'm a little confused with gaining access to the family controls capability.
Our app is ready to push to testflight, and we sent the request to apple last week. However only learning today that we need to request for the shield extension as well.
I wanted to ask what the expected timeline is for being approved?
I've seen posts here saying less than a week, and some people having to wait longer than 6 weeks.
Any advise or guidance on getting approved smoothly & swiftly would be highly appreciated
I'm trying to add keychain-access-groups capability to my app for MacOs devices and I'm getting an error while signing the code.
If I add this capability to an app for iOS devices, this does not happen and it works correctly. Are there any limitations to using this capability on MacOS devices?
My entitlement file is the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.cqesolutions</string>
</array>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
<key>com.apple.security.smartcard</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.cqesolutions.desktopDNIe</string>
<!--<string>$(AppIdentifierPrefix)com.apple.token</string>-->
<string>com.apple.token</string>
</array>
</dict>
</plist>
Topic:
Code Signing
SubTopic:
Entitlements