Today I experienced the following error from xcodebuild:
xcodebuild couldn't read dependency graph from ... .... : Permission denied
And further down:
Details: unable to write dependency graph: You don’t have permission to save the file “my-app.build” in the folder “my-target-iphoneos”.
I am documenting this since the cause is really obscure, see my answer.