xcodebuild 无法从中读取依赖关系图......:权限被拒绝

xcodebuild couldn't read dependency graph from ... .... : Permission denied

今天我在 xcodebuild 中遇到了以下错误:

xcodebuild couldn't read dependency graph from ... .... : Permission denied

再往下:

Details: unable to write dependency graph: You don’t have permission to save the file “my-app.build” in the folder “my-target-iphoneos”.

我正在记录这个,因为原因真的很模糊,请看我的回答。

如果您打开了 Xcode Organizer window,在尝试从命令行构建应用程序时,它会锁定构建目录,从而导致在文件权限错误中。

如果您关闭 Organizer window,您将能够再次从命令行构建。