Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Xcode Cloud MacOS app with restricted capability - cannot run tests

Xcode Cloud is unable to run unit tests for a MacOS target after adding a restricted capability (keychain-access-groups). Have tried setting both manual and automatic signing (with a Mac OS development profile). The tests run on my locally fine, but when pushed to Xcode Cloud the crash report indicates a Code Signing Issue, downloading the Artifact for Test Products for AppTests and viewing the app contents I noted that when built locally embedded.provisionprofile appears within the App/Contents that doesn't appear in Xcode Cloud. To reproduce, create a new MacOS app with a test plan, run a Test job (successfully runs) then add the capability for Keychain Sharing:

	<array>
		<string>$(AppIdentifierPrefix)com.transmedics.RemoteView.group</string>
	</array>

to the entitlements. Run the job again and tests with the project fails in Xcode Cloud, with code signing issues in the crash report.

@CharlesJe Does your issue still occur?

Yes, this issue still exists, however, I was able to bypass the issue and get our MacOS tests to run for now by adding to the ci_post_clone script for a build that is CI_PRODUCT_PLATFORM == "macOS" and CI_XCODEBUILD_ACTION == "build-for-testing" and using PlistBuddy to delete the key for the restricted entitlement. This is definitely not a good permanent solution.

Xcode Cloud MacOS app with restricted capability - cannot run tests
 
 
Q