Running a MacOS Intel app from XCode 14.1, trying to access the user’s home folders, in this case, the ~/Downloads folder.
I get
directoryEnumerator error at file:///Users/maurice/Library/Containers/com.utilitybeltsoftware.icloudstatus2/Data/Downloads/: Error Domain=NSCocoaErrorDomain Code=256 "The file “Downloads” couldn’t be opened." UserInfo={NSURL=file:///Users/maurice/Library/Containers/com.utilitybeltsoftware.icloudstatus2/Data/Downloads/, NSFilePath=/Users/maurice/Library/Containers/com.utilitybeltsoftware.icloudstatus2/Data/Downloads, NSUnderlyingError=0x6000011b2880 {Error Domain=NSPOSIXErrorDomain Code=20 "Not a directory"}}
If I cd to this location, I do get access to the ~/Downloads folder, so the error is not telling the truth.
Here is my entitlements plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.downloads.read-only</key>
<true/>
<key>com.apple.security.temporary-exception.files.home-relative-path.read-only</key>
<array>
<string>/Documents/</string>
<string>/Desktop/</string>
</array>
<key>com.apple.security.files.user-selected.read-only</key>
<true/>
</dict>
</plist>
By the way, I don’t get prompted to grant access to the app and that seems suspicious.