Test app in sandbox

Hello,


How can I test my Catalyst app in Sandbox mode on macOS? When running the app from Xcode, it already has access to for example location without asking for permissions.


If I archive the app and select distribution method "Developer ID" I get the following error message:

"Profile doesn't include the com.apple.developer.nfc.readersession.formats and com.apple.developer.siri entitlements."


I have tried deleting all of the profiles and let Xcode manage them, but still get the same error message - so I'm unable to export the app to other destinations than the App Store.

Answered by espen in 414885022

Found a way to remove the items in the entitlements file when building for the Mac Catalyst target. When doing that, I was able to export the app using "Developer ID".


Add a "Run Script" step in the build tab

if [ "${IS_MACCATALYST}" = "YES" ]; then  
    ENTITLEMENTS_FILE="${TARGET_TEMP_DIR}/${FULL_PRODUCT_NAME}.xcent"  
    
    plutil -remove "com\.apple\.developer\.nfc\.readersession\.formats" "${ENTITLEMENTS_FILE}"
    plutil -remove "com\.apple\.developer\.siri" "${ENTITLEMENTS_FILE}"
fi
Accepted Answer

Found a way to remove the items in the entitlements file when building for the Mac Catalyst target. When doing that, I was able to export the app using "Developer ID".


Add a "Run Script" step in the build tab

if [ "${IS_MACCATALYST}" = "YES" ]; then  
    ENTITLEMENTS_FILE="${TARGET_TEMP_DIR}/${FULL_PRODUCT_NAME}.xcent"  
    
    plutil -remove "com\.apple\.developer\.nfc\.readersession\.formats" "${ENTITLEMENTS_FILE}"
    plutil -remove "com\.apple\.developer\.siri" "${ENTITLEMENTS_FILE}"
fi
Thank you for posting your answer. This saved me a bunch of hair pulling.
Test app in sandbox
 
 
Q