
Gatekeeper helps macOS verify that downloaded apps come from identified developers and have not been altered. You can check Gatekeeper’s current status with spctl --status, inspect an app’s signature and notarization with codesign, and test whether macOS accepts an app with spctl --assess.
These commands are read-only: they do not enable or disable Gatekeeper, modify an app, or delete anything.
Quick Answer
- Open Terminal from Applications > Utilities.
- Check Gatekeeper:
bash
spctl --status
- Check an app’s signature:
bash
codesign --verify --deep --strict --verbose=2 "/Applications/App Name.app"
- Test whether Gatekeeper accepts the app:
bash
spctl --assess --type execute --verbose=4 "/Applications/App Name.app"
Replace App Name.app with the actual app name and location. A successful signature check normally ends with a message indicating that the app satisfies its designated requirement. A successful Gatekeeper assessment normally reports that the app is accepted.
What Gatekeeper and Code Signing Check
Gatekeeper is macOS’s assessment system for applications and other executable content. It can evaluate information such as an app’s developer signature, notarization status, and whether the app has been changed since it was signed.
Code signing attaches a cryptographic signature to an app. A valid signature helps confirm that the app’s contents have not changed since signing. It does not, by itself, prove that an app is safe or that you should trust its developer.
Notarization is a separate Apple review and scanning process. An app can have a valid developer signature without being notarized, depending on how it was distributed and the requirements applied by macOS.
The commands below help you inspect these properties without changing system security settings.
Find the Correct App Path
Before running a verification command, identify the app’s exact path. Applications installed for all users are commonly in /Applications, but an app may instead be in your home folder, Downloads, or another location.
In Finder:
- Open the folder containing the app.
- Control-click the app and choose Get Info to confirm its name.
- Make sure you are selecting the application bundle, whose name ends in
.app.
You can also drag the app from Finder into a Terminal window after typing a command. Terminal inserts the correct path, including escape characters for spaces.
For example, type the command up to the opening quote:
codesign --verify --deep --strict --verbose=2 "
Drag the app into the Terminal window, then type the closing quote and press Return. This avoids guessing the path.
If the app is in /Applications and is named Example.app, its path is:
/Applications/Example.app
Check Whether Gatekeeper Is Enabled
The spctl --status command reports whether the system assessment policy is enabled.

spctl --status
Interpret the result
A result such as the following indicates that assessment is enabled:
assessments enabled
If Terminal reports that assessments are disabled, Gatekeeper’s assessment policy has been turned off. That is a system security change, not merely an app-specific exception.
This command only reads the current state. It does not enable or disable Gatekeeper.
Re-enable Gatekeeper if necessary
If you intentionally need to restore the default assessment policy, use:
sudo spctl --master-enable
Terminal asks for an administrator password. Nothing appears while you type the password; press Return when finished.
This command changes system security behavior. Close important apps and save your work before running it. The safe recovery path is to run spctl --status again:
spctl --status
You should then see that assessments are enabled. If the command fails, do not repeatedly change settings; review the error and confirm that your account has administrator privileges.
Verify an App’s Code Signature
Use codesign to inspect whether an app’s signed contents pass signature validation.
The following command checks the app recursively, applies stricter validation, and requests detailed status information:
codesign --verify --deep --strict --verbose=2 "/Applications/App Name.app"
Replace the quoted path with the real path to the app.
What the options mean
--verifyaskscodesignto validate the signature.--deepchecks nested signed components inside the app bundle.--strictapplies stricter validation rules.--verbose=2requests additional diagnostic information.- The quoted path identifies the app to inspect.
A successful verification usually produces a message indicating that the app satisfies its designated requirement. Depending on the app and the macOS environment, the exact wording can vary.
A failure may indicate that:
- The app is unsigned.
- Part of the app was modified.
- A nested helper, framework, or plug-in failed validation.
- The path does not identify a complete application bundle.
- The app’s signature uses a format or requirement that the current system cannot validate.
codesign checks the signature; it does not repair it. Do not try to “fix” a failed signature by editing files inside the app bundle. If the app came from a developer or distribution service, download a fresh copy from the original source and compare the result.
View the signing identity and requirements
To display signing details without changing the app, use:
codesign --display --verbose=4 "/Applications/App Name.app"
This can show the signing identity, requirements, authorities, and other metadata. The amount and format of information depend on the app.
To ask specifically for the designated requirement, use:
codesign --display --requirements - "/Applications/App Name.app"
These are inspection commands. They do not alter the signature or the application.
If you also need to investigate file metadata associated with a downloaded app, see how to check extended attributes on Mac files using Terminal.
Test an App with Gatekeeper’s Assessment Tool
A valid signature does not necessarily mean Gatekeeper will accept an app for launch. Use spctl --assess to test the app against the system’s assessment rules.

spctl --assess --type execute --verbose=4 "/Applications/App Name.app"
What this command does
--assessasks macOS to evaluate the item.--type executeevaluates it as executable software.--verbose=4requests detailed assessment information.- The final argument is the app path.
A successful result normally identifies the app as accepted. A rejection may include information about the reason, such as an invalid signature, an untrusted source, or a policy requirement that was not met.
The exact output is not identical for every app. Treat the result as a diagnostic signal rather than a complete safety verdict.
Compare signature verification with assessment
For a useful two-part check, run both commands:
codesign --verify --deep --strict --verbose=2 "/Applications/App Name.app"
spctl --assess --type execute --verbose=4 "/Applications/App Name.app"
The first command checks the app’s signed contents. The second checks whether Gatekeeper’s assessment accepts the app for execution.
Possible outcomes include:
- Both commands succeed: The signature validates and Gatekeeper accepts the app under the current policy.
codesignsucceeds butspctlrejects: The signature may be valid, but the app may not satisfy another assessment requirement.codesignfails: The app or one of its nested components failed signature validation.- Both commands fail: Investigate the path, app source, bundle contents, and error messages before launching it.
Check an App’s Quarantine Attribute
Downloaded files can carry a quarantine extended attribute that records download-related information. This attribute is one part of macOS’s handling of downloaded content and can help explain why an app receives an additional warning.
To inspect the app’s extended attributes, run:
xattr -l "/Applications/App Name.app"
This command lists metadata; it does not remove anything.
You may see an attribute named com.apple.quarantine, but its presence or absence should not be treated as a complete security decision. An app can still require assessment for other reasons.
Avoid commands that remove quarantine metadata merely to bypass a warning. Removing metadata changes how macOS handles the item and can eliminate useful security context. If you need to understand extended attributes in more detail, use the Terminal guide to checking extended attributes.
Use a Specific App Location Safely
Paths with spaces must be quoted or escaped. These examples refer to the same general location:
spctl --assess --type execute --verbose=4 "/Applications/Example App.app"
spctl --assess --type execute --verbose=4 /Applications/Example App.app
Quoting the complete path is usually easier to read and less error-prone.
If the app is in Downloads, use its full path:
spctl --assess --type execute --verbose=4 "$HOME/Downloads/Example App.app"
The $HOME variable expands to your home folder. It does not change files.
For an app in your personal Applications folder, use:
spctl --assess --type execute --verbose=4 "$HOME/Applications/Example App.app"
Do not run a command against a path copied from an untrusted source without checking it first. A misplaced quote or unexpected shell character can cause Terminal to interpret a path differently than intended.
Troubleshooting
“No such file or directory”
The path is incorrect, the app was moved, or the app name does not exactly match. In Finder, locate the app and drag it into Terminal to insert its path automatically.
You can also list the standard Applications folder:
ls -ld /Applications/*.app
This lists application bundles in /Applications; it does not modify them.
“code object is not signed at all”
The app, or a component being checked, does not have a code signature that codesign can validate. Confirm that you selected the actual .app bundle rather than a folder, disk image, archive, or alias.
If the result is unexpected, obtain the app again from its original developer or a trusted distribution source.
spctl rejects an app that codesign accepts
These commands answer different questions. codesign focuses on signature validity, while spctl applies Gatekeeper assessment policy. Read the detailed spctl output and confirm that you are assessing the intended app path.
Do not disable Gatekeeper just to make the test pass. If you choose to open a known app through a normal macOS approval workflow, understand that doing so can override a warning for that app without proving that the software is safe.
Terminal says permission is denied
The app may be inside a protected location, or Terminal may lack access to a folder protected by macOS privacy controls. Check System Settings > Privacy & Security and review relevant permissions for Terminal only when necessary.
Avoid granting broad permissions permanently if a simpler path or Finder-based check will work.
A command appears to do nothing
Successful verification commands may produce little or no output, depending on the command and verbosity level. Check the exit status immediately after a command with:

echo $?
An exit status of 0 generally indicates success for the command that just ran. A nonzero value indicates that it reported a problem. Run echo $? before executing another command, because it reports only the most recent command’s status.
Do not use sudo casually
The verification commands in this guide do not require administrator privileges. Do not add sudo to codesign, spctl --assess, or xattr commands unless you have a specific administrative reason and understand the consequences.
Administrator privileges do not make an invalid signature valid, and they do not make an untrusted app safe.
Frequently Asked Questions
Does spctl --status verify a specific app?
No. It reports whether the system assessment policy is enabled. Use spctl --assess with an app path to evaluate a specific application.
Does a valid code signature mean an app is safe?
No. A valid signature indicates that signed content passed signature validation and is associated with a signing identity. It does not guarantee that the developer is trustworthy, that the app is free of vulnerabilities, or that it is appropriate for your Mac.
Can I check an app without opening it?
Yes. codesign, spctl --assess, and xattr -l inspect the app without launching it.
Will these commands modify the app?
No. The commands shown for checking status, signatures, assessment, and attributes are read-only. sudo spctl --master-enable is different: it changes the system’s Gatekeeper policy and should be used only when you intend to restore assessments.
Should I remove the quarantine attribute?
Generally, no. Removing it changes security-related metadata and can bypass part of macOS’s normal handling of downloaded content. Investigate the app’s source and assessment result instead.
Why does the output differ between apps?
Apps can use different signing arrangements, nested components, distribution methods, and metadata. The exact output can therefore vary. Focus on whether validation succeeds and read any diagnostic error carefully.
Final Thoughts
Terminal gives you three useful checks: spctl --status reports the system’s Gatekeeper state, codesign validates an app’s signed contents, and spctl --assess tests the app against Gatekeeper’s current policy. Use all three when you need a clearer picture, but treat their results as security diagnostics—not a substitute for obtaining software from a trustworthy source.