Our app .dmg file was successfully code signed. We then revised the app and created a new .dmg.
Running codesign gave an "app is already signed" message. Then running codesign -dv said "code object is not signed at all"
Older solutions said to use -f to force signing, but that is no longer an option.
General
RSS for tagDemystify 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
We have an app which is hybrid using React Native and Native features. We released our app recently which showed issues related to missing packages/corrupt package but xCode didn't gave any error and we were able to Archive and submit app successfully.
Topic:
Code Signing
SubTopic:
General
Hi guys,
Is there any good up-to-date tutorial about publishing a Python based app on Apple Store?
Now, I have developed a standalone Python app from PyCharm, and it's using Pyside6 for UI and some major Python libraries. It's a productivity app with a little A.I. features. I used PyInstaller to prepare the app. Currently, I am stuck at the stage of codesign and Apple Review process, because I am manually doing codesign and building the package from command-line. Without using Xcode, things can get messy or miss easily.
It would be nice to follow a up-to-date tutorial about how to complete the codesign and Apple Review process for a Python based app. For example, what to do, how to do, what to be careful during the Apple Review process, etc. Thanks!
Hello Apple Developer Support Community,
I am encountering a persistent issue while trying to code sign my macOS application (PromptVault.app) using a valid Developer ID Application certificate. The signing process fails with the following warning and error for every native .so file inside the app bundle:
`Warning: unable to build chain to self-signed root for signer "(null)"
<file-path>: errSecInternalComponent`
What I have tried so far:
Verified that my Developer ID Application certificate and the associated private key exist correctly in the login keychain.
Confirmed that the intermediate certificate "Apple Worldwide Developer Relations - G6" is installed and valid in the System keychain.
Added Terminal to Full Disk Access in Security & Privacy to ensure signing tools have required permissions.
Executed security set-key-partition-list to explicitly allow code signing tools to access the private key.
Reinstalled both developer and Apple intermediate certificates.
Used codesign to individually sign .so files and then sign the entire bundle.
Ensured macOS and Xcode Command Line Tools are up to date.
Created a clean Python virtual environment and rebuilt all dependencies.
Tested code signing in multiple ways and with verbose logging.
Current status:
Despite all these efforts, the same warning and error persist during the signing process of every .so file. This prevents successful code signing and notarization, blocking distribution.
Request for assistance:
Could anyone confirm if my certificate and keychain setup sounds correct?
Are there known issues or extra steps necessary to properly build the trust chain for Developer ID certificates on macOS 15.6.1 (Sequoia)?
Any suggestions for resolving the errSecInternalComponent during signing native libraries?
Guidance on ensuring the entire certificates chain is trusted and usable by codesign tools?
I can provide debug logs, screenshots of my keychain and security settings, or any other diagnostic information if needed.
Thanks in advance for your help!
Your development team has reached the maximum number of registered iPhone devices.
I am use the free provisioning file.
So how can I delete old device and use my new iPhone to develop my app.
only way is use a paid account?
or register a new Apple ID?
Topic:
Code Signing
SubTopic:
General
I am experiencing a persistent issue when trying to sign my application, PhotoKiosk.app, using codesign. The process consistently fails with the error errSecInternalComponent, and my troubleshooting indicates the problem is with how the system accesses or validates my certificate's trust chain, rather than the certificate itself.
Error Details and Configuration:
codesign command executed:
codesign --force --verbose --options=runtime --entitlements /Users/sergiomordente/Documents/ProjetosPhotocolor/PhotoKiosk-4M/entitlements.plist --sign "Developer ID Application: Sérgio Mordente (G75SJ6S9NC)" /Users/sergiomordente/Documents/ProjetosPhotocolor/PhotoKiosk-4M/dist/PhotoKiosk.app
Error message received:
Warning: unable to build chain to self-signed root for signer "(null)"
/Users/sergiomordente/Documents/ProjetosPhotocolor/PhotoKiosk-4M/dist/PhotoKiosk.app: errSecInternalComponent
Diagnostic Tests and Verifications Performed:
Code Signing Identity Validation:
I ran the command security find-identity -v -p codesigning, which successfully confirmed the presence and validity of my certificate in the Keychain.
The command output correctly lists my identity:
D8FB11D4C14FEC9BF17E699E833B23980AF7E64F "Developer ID Application: Sérgio Mordente (G75SJ6S9NC)"
This suggests that the certificate and its associated private key are present and functional for the system.
Keychain Certificate Verification:
The "Apple Root CA - G3 Root" certificate is present in the System Roots keychain.
The "Apple Worldwide Developer Relations Certification Authority (G6)" certificate is present and shown as valid.
The trust setting for my "Developer ID Application" certificate is set to "Use System Defaults".
Attempted Certificate Export via security:
To further diagnose the problem, I attempted to export the certificate using the security find-certificate command with the exact name of my identity.
Command executed (using double quotes):
security find-certificate -c -p "Developer ID Application: Sérgio Mordente (G75SJ6S9NC)" > mycert.pem
Error message:
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
The same error occurred when I tried with single quotes.
This result is contradictory to the output of find-identity, which successfully located the certificate. This suggests an internal inconsistency in the Keychain database, where the certificate is recognized as a valid signing identity but cannot be located via a simple certificate search.
Additional Troubleshooting Attempts:
I have already recreated the "Developer ID Application" certificate 4 times (I am at the limit of 5), and the issue persists with all of them.
The application has been rebuilt, and the codesign command was run on a clean binary.
Conclusion:
The problem appears to be an internal macOS failure to build the trust chain for the certificate, as indicated by the errSecInternalComponent error. Although the certificate is present and recognized as a valid signing identity by find-identity, the codesign tool cannot complete the signature. The failure to find the certificate with find-certificate further supports the suspicion of an inconsistency within the keychain system that goes beyond a simple certificate configuration issue.
I would appreciate any guidance on how to resolve this, especially given that I am at my developer certificate limit and cannot simply generate a new one.
Can you please help us with the scenario below, including details and Apple’s recommendations?
I've already read through the Notarization and Gatekeeper documentation.
The installed version of our application is 1.2.3, located in /Applications/XYZSecurity.app.
We created an upgrade package for version 1.2.4. As part of the pre-install script in the 1.2.4 installer, we explicitly deleted some obsolete .dylib files from /Applications/XYZSecurity.app/Contents/Frameworks and some executable files from
/Applications/XYZSecurity.app/Contents/MacOS that were no longer needed in version 1.2.4.
The installation of version 1.2.4 completed successfully, but we see the below error logs in installer.log:
PackageKit: Failed to unlinkat file reference /Applications/XYZSecurity.app/Contents/Frameworks/libhelper.dylib
PackageKit: Failed to unlinkat file reference /Applications/XYZSecurity.app/Contents/MacOS/helper-tool
Our Key Questions:
Is it the right practice to remove obsolete files in the pre-install script during an upgrade?
Is this approach recommended by Apple?
Can this cause any issues with Apple Gatekeeper? Is there a possibility of my application getting blocked by Gatekeeper as a result?
I tried building a macOS app with Electron, but I ran into problems during notarization.
I used notarytool to upload my DMG and got status: Invalid.
xcrun notarytool log output
{
"logFormatVersion": 1,
"jobId": "680bf475-a5f4-4675-9083-aa755d492b18",
"status": "Invalid",
"statusSummary": "Archive contains critical validation errors",
"statusCode": 4000,
"archiveFilename": "BODYPARK-v3.6.0-mac.app.zip",
"uploadDate": "2025-09-25T02:50:41.523Z",
"sha256": "e61074b9bba6d03696f2d8b0b13870daafc283960e61ab5002d688e4e82ef6f6",
"ticketContents": null,
"issues": [
{
"severity": "error",
"code": null,
"path": "BODYPARK-v3.6.0-mac.app.zip/BODYPARK-v3.6.0-mac.app/Contents/Resources/plugin/XMagic/mac/libpag.framework/libpag",
"message": "The signature of the binary is invalid.",
"docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087735",
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "BODYPARK-v3.6.0-mac.app.zip/BODYPARK-v3.6.0-mac.app/Contents/Resources/plugin/XMagic/mac/libpag.framework/libpag",
"message": "The signature does not include a secure timestamp.",
"docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "BODYPARK-v3.6.0-mac.app.zip/BODYPARK-v3.6.0-mac.app/Contents/Resources/plugin/XMagic/mac/libpag.framework/libpag",
"message": "The signature of the binary is invalid.",
"docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087735",
"architecture": "arm64"
},
{
"severity": "error",
"code": null,
"path": "BODYPARK-v3.6.0-mac.app.zip/BODYPARK-v3.6.0-mac.app/Contents/Resources/plugin/XMagic/mac/libpag.framework/libpag",
"message": "The signature does not include a secure timestamp.",
"docUrl": "https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/resolving_common_notarization_issues#3087733",
"architecture": "arm64"
}
]
}
I checked the signature of my .app file:
codesign -v -vvv --deep --strict /Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/MacOS/BODYPARK-v3.6.0-mac
--prepared:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/BODYPARK-v3.6.0-mac Helper (GPU).app
--validated:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/BODYPARK-v3.6.0-mac Helper (GPU).app
--prepared:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/BODYPARK-v3.6.0-mac Helper (Plugin).app
--validated:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/BODYPARK-v3.6.0-mac Helper (Plugin).app
--prepared:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/TXFFmpeg.framework/Versions/Current/.
--validated:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/TXFFmpeg.framework/Versions/Current/.
--prepared:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/Electron Framework.framework/Versions/Current/.
--prepared:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/Electron Framework.framework/Versions/Current/Helpers/chrome_crashpad_handler
--validated:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/Electron Framework.framework/Versions/Current/Helpers/chrome_crashpad_handler
--validated:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/Electron Framework.framework/Versions/Current/.
--prepared:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/TXSoundTouch.framework/Versions/Current/.
--validated:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/TXSoundTouch.framework/Versions/Current/.
--prepared:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/BODYPARK-v3.6.0-mac Helper.app
--validated:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/BODYPARK-v3.6.0-mac Helper.app
--prepared:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/BODYPARK-v3.6.0-mac Helper (Renderer).app
--validated:/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/Frameworks/BODYPARK-v3.6.0-mac Helper (Renderer).app
/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/MacOS/BODYPARK-v3.6.0-mac: valid on disk
/Users/zhangheng/Desktop/development/coach-app/dist_electron/mac-universal/BODYPARK-v3.6.0-mac.app/Contents/MacOS/BODYPARK-v3.6.0-mac: satisfies its Designated Requirement
It looks like local signing succeeded, but notarization is failing. I’m a beginner with macOS signing/notarization. Could you please help me figure out what I’m doing wrong and how to fix this? I’d really appreciate any guidance.
I want to export Mac OS application out side App Store and I need to have Developer Id installer certificate to do the same.
When I go to certificate section in developer portal - I only see option of
Mac App Distribution
Mac Installer Distribution
Developer ID Application
Does anyone know where I can check the Developer ID installer part. Developer ID application doesn't work for signing the app manually.
Hey,
Just recently I realized something I have been overlooking in my build pipelines.
I thought that by adding the the "hardened runtime", I disable 3rd-party library injection (I do not have the disable-library-validation entitlement added).
However, I was using some checks on my code and I noticed that the "library validation" code signature check fails on my applications (e.g. adding the .libraryValidation requirement via the LightweightCodeRequirements framework) - with codesign -dvvvv /path/to/app I can check it doesn't have the CS_REQUIRE_LV flag:
[...]
CodeDirectory v=20500 size=937 flags=0x10000(runtime) hashes=18+7 location=embedded
[...]
then I used in Xcode the "Other Code Signing Flags" setting and added the -o library option, which added the flag:
[...]
CodeDirectory v=20500 size=937 flags=0x12000(library-validation,runtime) hashes=18+7 location=embedded
[...]
Is this flag something I should be explicitly setting? Because I was under the impression enabling hardened runtime would be enough. Popular Developer ID distributed applications (e.g. Google Chrome, Parallels Desktop, Slack) all have this flag set.
The Developer App Certificate is not trusted.
Topic:
Code Signing
SubTopic:
General
I have a free developer account, and I have been creating applications. When I tried to open one of them, it said that this app has been flagged as malware. It is not malware, so I don't know why it has been flagged as this. Not just this app, but suddenly a whole bunch of my apps have been flagged as malware as well!
The app I have been developing is basically a windows Taskbar for my macbook air, and it has been working well until the latest update i made where it hides in full screen, suddenly it started taking up significant energy, so i reverted to an older version while i was fixing it. Then, when i try to open it another time, it starts to open, and it says "Malware Blocked and Moved to Bin" “Taskbar.app” was not opened because it contains malware. This action did not harm your Mac”. All versions of the taskbar now contain this message. I try opening some of my other apps, a shared storage client and a shared storage server (where i was testing with app groups), and they couldn't open either, the same malware message appeared. ProPermission couldn't open either (changes permissions on files for me so i don't have to use the terminal or finder). I can run these apps through the Xcode environment (attached process), but when I archieve it into an app bundle, the malware flag appears.
Please note that I am certain that these apps do not contain malware, apparently XProtect has incorrectly flagged my apps as malware. Because I do not have the paid developer account, I cannot notarize my apps.
I am using MacOS Tahoe 26.1 with Xcode 26.0, and I have tested it with a iMac Intel 2017 with MacOS Ventura.
I am using a Sonoma VM (14.6) where i have installed xcode 16.2. When i try login into apple id into xcode, i am getting this error. I know i am entering the correct credentials.
Not sure why this issue is.
In other Sequioa and Tahoe VM , i was able to login.
I'm experiencing an issue when exporting an Enterprise distribution certificate where the certificate and private key won't export together - the private key keeps getting left out.
I'm running macOS Tahoe. Has anyone encountered the same issue or know of a solution? Any help would be appreciated.
Topic:
Code Signing
SubTopic:
General
Hello Apple Developer Forum Community,
I’ve got a problem with the signing process of my AppClip Test App. Can someone help me? As I don’t know hot to get the certificate...
I am trying to code sign an application which relies on many python libraries to run. For background knowledge, the .app was created with a —onefile command on Visual Studio.
I code signed my application itself using
codesign --deep --force --verify --timestamp --sign "Developer ID Application: Issey Yohannes (GL5BCCW69X)" /Users/isseyyohannes/Desktop/Automated\ ALGORA.app
However, when I try to run the application the error shows in terminal as follows
[PYI-16345:ERROR] Failed to load Python shared library '/var/folders/g9/2zbc7y_97xxbq7bnc301nnyc0000gn/T/_MEI6keRcA/Python': dlopen: dlopen(/var/folders/g9/2zbc7y_97xxbq7bnc301nnyc0000gn/T/_MEI6keRcA/Python, 10): no suitable image found. Did find:
/var/folders/g9/2zbc7y_97xxbq7bnc301nnyc0000gn/T/_MEI6keRcA/Python: code signature in (/var/folders/g9/2zbc7y_97xxbq7bnc301nnyc0000gn/T/_MEI6keRcA/Python) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
/var/folders/g9/2zbc7y_97xxbq7bnc301nnyc0000gn/T/_MEI6keRcA/Python: stat() failed with errno=1
Through some external tools, I was able to narrow the issue as follows
Hardened Runtime Restriction: Your application is attempting to load a shared library (Python) at runtime, but the library is either: Not properly signed with the same Team ID as your app. Not marked as a valid platform binary. macOS requires all loaded libraries to comply with its code-signing and runtime security policies.
Any insight is much appreciated.
Topic:
Code Signing
SubTopic:
General
I've noticed that NSTaks has this property as of macOS 14.4
@property (nullable, copy) NSData *launchRequirementData API_AVAILABLE(macos(14.4)) API_UNAVAILABLE(ios, watchos, tvos, visionos);
It has no documentation whatsoever. Even google search has no clue. Does this have anything to do with code signature requirements validation? Any explanations and examples would be appreciated!
Hi everyone. Sorry if this is not an appropriate forum section for this question. I'm making a game engine and it doesn't launch on my colleague's MacBook, although it does launch on mine.
There's an application file, let's say, Sample.app. And along with it in the same folder there's Engine.dylib. If we look at the app-file structure, the executable file's path is Contents/MacOS/Sample. So for the executable file the library is located at the path ../../../Engine.dylib. But when my colleague runs the Sample.app file, he gets an error "Library not loaded: @executable_path/../../../Engine.dylib". Although the path is correct and on my MacBook it works. Are there any ideas how to fix it?
Topic:
Code Signing
SubTopic:
General
Hi,
I'm doing Java 22 experiments with open source package "wgpu-macos-aarch64-release" on my Mac M3.
This library contains a .dylib file and a .a file.
In Java you can load native dynamic libraries using JNI. I used that in the past. Now in MacOS 15 this stopped working.
Currently, I compile my Java file and run the binary file on the command line, including the library directory. The application would load the library from that directory. This should normally works but the library is not loaded.
After some investigation it seems the .dylib is rejected by MacOS.
Calling
spctl --assess --verbose=4 libwgpu_native.dylib
gives
libwgpu_native.dylib: rejected
without any extra reason message.
Using
sudo xattr -rd com.apple.quarantine libwgpu_native.dylib
doesn't solve the problem.
I also can't "accept" it in "Privacy & Security" because it's run as a command line call.
I know that code signing should be done for "complete" applications. But these are just experiments and working with single dynamic libraries.
How should this be done, to be able to load those libraries in a Java command line program? Or in general, how can you load an unsigned dylib in an application (apart from using Java as a tool).
Kr,
J
Topic:
Code Signing
SubTopic:
General
I am developing a macOS app that requires the Associated Domains entitlement. The app will be distributed as a custom app.
The app needs to be signed using Team A’s Developer ID Application certificate and packaged under Team A’s Team ID.
Team A has a secure signing and packaging setup, but they do not provide access to their Developer ID Application Identity (cert) or their provisioning profile.
I am part of Team B and have access to Team B’s Developer ID Application identity and provisioning profiles.
I am thinking of doing the following:
I create a provisioning profile under Team B that authorizes the Associated Domains entitlement.
I sign the app using Team B’s Developer ID Application identity, ensuring the required entitlements are included.
Then, I re-sign the app using Team A’s Developer ID Application identity, since Team A has also set up the same bundle ID with the Associated Domains entitlement and corresponding provisioning profile.
Questions:
Is this approach correct & does it have any drawback?
Will the double signing process work without issues, given that Team A has the required provisioning profile for the same bundle ID?
Are there better ways to handle this situation where signing must be done under Team A but access is limited?
Thanks!