Skip to content

How to Fix macOS Gatekeeper Blocked App

DodaTech Updated 2026-06-24 3 min read

In this tutorial, you'll learn about How to Fix macOS Gatekeeper Blocked App. We cover key concepts, practical examples, and best practices.

The Problem

You download an application and macOS prevents it from opening:

"MyApp" can't be opened because it is from an unidentified developer.

Or:

"MyApp" cannot be opened because the developer cannot be verified.
macOS cannot verify that this app is free from malware.

Gatekeeper blocks apps that are not signed with an Apple Developer certificate or have not been notarized by Apple.

Quick Fix

Step 1: Open the app via Security & Privacy

  1. Open System Preferences > Security & Privacy > General
  2. Look for the message: "MyApp was blocked from opening because it is not from an identified developer."
  3. Click Open Anyway
  4. Enter your administrator password

Step 2: Right-click to open (override)

  1. Right-click (or Ctrl-click) the application
  2. Select Open from the context menu
  3. Click Open in the confirmation dialog

This one-time bypass works for Gatekeeper-blocked apps.

Step 3: Remove the quarantine attribute

xattr -dr com.apple.quarantine /Applications/MyApp.app

The com.apple.quarantine extended attribute marks files downloaded from the internet. Removing it bypasses Gatekeeper for that file.

Step 4: Create a code signature (advanced)

If the app is unsigned, you can sign it with an ad-hoc signature:

codesign --force --deep --sign - /Applications/MyApp.app

The - specifies ad-hoc signing (no Apple certificate). This may satisfy Gatekeeper on some macOS versions.

sudo spctl --master-disable

This disables Gatekeeper system-wide. Re-enable after installing:

sudo spctl --master-enable

Step 6: Notarize the app (for developers)

If you distribute an app, submit it for notarization:

xcrun notarytool submit MyApp.dmg --apple-id your@email.com --team-id TEAMID --password @keychain:AC_PASSWORD
xcrun stapler staple MyApp.dmg

Notarized apps pass Gatekeeper without user intervention.

Step 7: Check the app's quarantine status

xattr -l /Applications/MyApp.app

If com.apple.quarantine exists, the app was downloaded from the internet.

Prevention

  • Download apps from the Mac App Store or official developer websites.
  • Developers: Notarize all distributed builds.
  • Do not disable Gatekeeper permanently.

Common Mistakes with gatekeeper blocked

  1. Placing the wildcard pattern first in case expressions, making all subsequent patterns unreachable
  2. Using head and tail instead of pattern matching, causing runtime errors on empty lists
  3. Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks

These mistakes appear frequently in real-world MACOS code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### Is it safe to bypass Gatekeeper?

Only for apps from trusted sources. Gatekeeper protects against malware. If you are unsure about an app, verify its hash against the developer's published checksum.

Why does an app from the App Store trigger Gatekeeper?

App Store apps are signed by Apple and should not trigger Gatekeeper. If they do, reinstall from the Purchased tab.

What is the quarantine attribute?

com.apple.quarantine is an extended attribute that macOS adds to files downloaded from the internet. Gatekeeper checks this attribute before launching the app.

DodaTech Tool Reference

Durga Antivirus Pro scans apps that bypass Gatekeeper, providing an additional malware check before the first launch.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro