Xcode 15 beta does not allow run script access to .git/HEAD and Info.plist

1k Views Asked by At

To access the current git branch and commit, I have been using this script successfully for a long time.
However, with Xcode 15.0 beta, the script has no longer access to the git and Info.plist files. I am getting these errors:

error: Sandbox: git(64989) deny(1) file-read-data <MyFolder>/.git/HEAD  
error: Sandbox: PlistBuddy(64994) deny(1) file-read-data <MyFolder>/Info.plist  

Is it possible to allow access to these files again?

2

There are 2 best solutions below

1
jpb On BEST ANSWER

In your build settings, you can set "User Script Sandboxing" to "No".

Screenshot of setting "User Script Sandboxing" to no in Xcode 15

0
ElegyD On

For me, adding the files that PlistBuddy is about to edit to the Output Files of the Run Script did fix the issue.
This is probably more safe than disabling the whole sandboxing.