Gatekeeper Alerts When Running on Mac Catalyst

Q: I am experiencing the following alerts when running on Mac Catalyst from Xcode. How can I fix the issue?

“PSPDFKit.framework” is damaged and can’t be opened. You should move it to the Trash “Instant.framework” cannot be opened because the developer cannot be verified

A: For Mac Catalyst, Xcode is finding the XCFrameworks extracted frameworks in the build directory and trying to link them instead of the signed frameworks in the app bundle. This issue only occurs when integrating PSPDFKit manaually.

To fix this issue, you can either integrate PSPDFKit using Swift Package Manager, or you can add the following Run Script Phase script to your app’s target to remove the quarantine attribute that could have been added during the download:

Copy
1
2
3
4
5
6
7
8
9
10
11
# For Mac Catalyst, Xcode is finding the XCFrameworks extracted frameworks in the build directory
# and trying to link them instead of the signed frameworks in the app bundle.
# We remove the quarantine attribute that could have been added during download
# so that this doesn't lead to a warning when the app is launched via Xcode.
if [ "${IS_MACCATALYST}" = "YES" ]; then
    for framework in $TARGET_BUILD_DIR/*.framework; do
        if [ -d "$framework" ]; then
            xattr -d -r com.apple.quarantine "$framework"
        fi
    done
fi

For more details, take a look the “Clear Quarantine Attribute” Run Script Phase script from the Catalog example project.