Cannot open: operation not permitted

This is one log line, manually wrapped here for the sake of readability:

profiling: ~/Library/Developer/Xcode/DerivedData/<AppName>-bhgeoalyqrkckjctcvncxgyzlbmm/Build/Interm
ediates/<AppName>.build/Debug/<AppName>.build/Objects-normal/x86_64/<AppName>_vers.gcda: cannot open:
Operation not permitted


Anyone seen this before or know what it means? I'm getting about 6100 of these in the debugger console each time I quit my app. These are not log messages—they appear only when I run within Xcode. I think it might have something to do with profile-guided optimization (PGO), but I haven't had the time (or the need 🙂) to look into it.

Accepted Reply

Erased my Xcode derived data (using the Projects window) and started fresh; now it's fixed. Apparently some permissions got scrambled inside there.

Replies

What platform are you targeting? If it’s OS X, is this is a sandboxed app?

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Sorry, I forgot to mention that yes, it is a sandboxed OS X app. It's been sandboxed for years, but I only started seing the messages around the time I enabled PGO. And I'm 100% sure this isn't an accidental sandbox violation:

  • These are not system log messages—they do not appear in the Console, only within Xcode. Notice that the log message header is not present.
  • Notice that the paths are deep down inside my derived data. My app never writes there.
  • Lastly, did you notice the "profiling:" message?

Erased my Xcode derived data (using the Projects window) and started fresh; now it's fixed. Apparently some permissions got scrambled inside there.