Not able to Read or Write to "/Contents/Resource" folder with Xcode 14.3.1

I have my macOS app, which I'm distributing outside the MAC App Store through Notarizing the App. When my end-user unzipped my App (which they downloaded from a shared URL path) and opened it, It crashed after the first time opening (by clicking on the Gatekeeper check popup: "Chrome downloaded this file today at 11:10 AM. Apple checked it for malicious software and none was detected. ")

In my macOS app (distributing outside the MAC App Store through Notarizing the app), though I removed AppSandbox capability, I am still not able to read/write to the Resource folder.

Error

Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “SupportTextFiles” in the folder “Resources”." UserInfo={NSFilePath=/x.app/Contents/Resources/SupportTextFiles, NSUnderlyingError=0x6000030e3c00 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}

Accepted Reply

You shouldn’t have any problems reading the contents of your bundle, but modifying its contents is another story. I address this specifically in the Separate read-only and read/write content section of Embedding nonstandard code structures in a bundle. Historically the Mac was pretty lax about enforcing that rule, but that’s starting to change.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Replies

You shouldn’t have any problems reading the contents of your bundle, but modifying its contents is another story. I address this specifically in the Separate read-only and read/write content section of Embedding nonstandard code structures in a bundle. Historically the Mac was pretty lax about enforcing that rule, but that’s starting to change.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"