The fix if you want to keep ENABLE_USER_SCRIPT_SANDBOXING enabled is to add the files as inputs and outputs. I use a script to set the build number in the build info plist file.
I just need to set "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" as an output of the script
build setting ENABLE_USER_SCRIPT_SANDBOXING was added in Xcode 14 but enabled in the update to recommend setting in Xcode 15
From the Xcode 14 Release Notes:
You can now enable sandboxing for shell script build phases using the ENABLE_USER_SCRIPT_SANDBOXING build setting. Sandboxing blocks access to files inside the source root of the project as well as the Derived Data directory unless you list those files as inputs or outputs. When enabled, the build fails with a sandbox violation if a script phase attempts to read from or write to an undeclared dependency, preventing incorrect builds.
Thanks to Daniel Jalket's Blog Post: Xcode Build Script Sandboxing -
https://indiestack.com/2023/06/xcode-build-script-sandboxing/
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: