Back to Home

Strip macOS Quarantine from .bundle Files

May 20, 2026 Technology

When you sync your own code from Google Drive, an external drive, or another Mac, macOS stamps every file with a quarantine attribute. The OS then refuses to load .bundle files (Unity plugins, native libraries, etc.) and yells at you about untrusted code — even though the code is yours.

This little script walks the directory it lives in and strips the com.apple.quarantine attribute off every .bundle file underneath it. Safe to run repeatedly — if there's nothing to clear, it just does nothing.

strip_quarantine.sh

#!/bin/bash
# strip_quarantine.sh
# Run this after syncing your code from Google Drive on Mac or any other source.
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
echo "Stripping quarantine attributes from all .bundle files..."
find "$SCRIPT_DIR" -name "*.bundle" -exec xattr -rd com.apple.quarantine {} \;
echo "Done."

How to use it

Save the snippet as strip_quarantine.sh in the root of your project (next to your .bundle files, or one folder above them). Then, in Terminal:

chmod +x strip_quarantine.sh
./strip_quarantine.sh

Why this happens

macOS's Gatekeeper system tags every file that arrives from outside the local filesystem with an extended attribute called com.apple.quarantine. Google Drive, AirDrop, and downloads from Safari all set it. When Unity, Xcode, or the system loader tries to open a quarantined .bundle, you get the “cannot be opened because the developer cannot be verified” warning — even when you wrote the bundle yourself on another machine an hour ago.

The script removes that one attribute. Nothing else about the file changes. Only run this on code you trust — the quarantine attribute exists for a reason, and you should not strip it from binaries you grabbed from a stranger.