While trying to reset permissions on Xcode/CoreSimulator directories with:
sudo chmod -RN ~/Library/Developer/Xcode ~/Library/Developer/CoreSimulator ~/Library/Logs/CoreSimulator
The command fails with a byzantine error:
chmod: Failed to clear ACL on file PreviewWellImage.jpg: No such file or directory
I can see online notes about that PreviewWellImage.tiff but not PreviewWellImage.jpg. I figured advice for the TIFF would be pertinent to the JPG ACL error so I explored the questions and answers around it, but none were for what I was chasing.
Even though PreviewWellImage.jpg was never referenced explicitly in the command I typed, a stale ACL entry in the tree pointed to that missing file, and chmod -RN aborted on the first error. There’s no way to ask it to push through encounted errors toward the larger goal.
The workaround is that instead of a single recursive chmod -RN that bails on missing paths, clear ACLs per existing node and ignore errors, then fix ownership/permissions:
sudo find ~/Library/Developer/Xcode -exec chmod -N {} + 2>/dev/null
sudo find ~/Library/Developer/CoreSimulator -exec chmod -N {} + 2>/dev/null
sudo chown -R "$USER":staff ~/Library/Developer/Xcode ~/Library/Developer/CoreSimulator ~/Library/Logs/CoreSimulator
sudo chmod -R u+rwX,go-w ~/Library/Developer/Xcode ~/Library/Developer/CoreSimulator ~/Library/Logs/CoreSimulator
Context: Well, I was trying to solve larger permissions errors after deleted and reinstall of XCode and sim bits and pieces didn’t work, and before re-imaging the MacMini in question.
Question: Is there a smaller more concise fix that would have been the canonical solution to the same issue?