I used to be able to test my app by making it save files to a temp folder (with a file URL created in the XCUITest runner), and then comparing them to files in the test bundle, but in Sonoma, this will issue a blocking "[App name] wants to access files from other apps" security alert, which has to be dismissed manually. This breaks the test flow.
It kind of makes sense, as I'm trying to save from the app to the temp folder of another app (the test runner.) Is there any way around this? Is there a temp folder that both applications can access without security alerts?
It kind of makes sense
Yep. This is one aspect of the new container data protection feature of macOS 14. See the link in Trusted Execution Resources.
Is there any way around this?
I’m not sure if there’s a way around this within the XCTest space. However, you could try saving these files to /Users/Shared
. AFAIK that’s still a free-for-all space.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"