If you run into this with your projects, it sounds like a better fix is to specify the specific input and output files so that the script phase is allowed access only to the files you think it should be working with. Luckily when I searched the build settings for the word “sandbox” it turned up the setting, and I was able to turn it off. I had added a custom Run Script phase to my project in order to finesse the contents of the built product, but when the script ran I was greeted with this error:Įrror: Sandbox: cp(25322) deny(1) file-read-data /Users/daniel/Project/File.txt How was I reminded? Because evidently, starting in Xcode 15, the build setting now defaults to YES. If I noticed it last year I had already forgotten about it, but I was reminded today while putting together a sample app to demonstrate a bug I was reporting. 2nd run: Xcode runs Run Script Build Phase' -> everything is up-to-date 2nd run: Xcode proceeds to compilation After reading Xcode documentation on Build Phases, I tried adding a source file which is known to be updated every time the script is run as the output of 'Run Script Build Phases', but nothing changed. 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. ![]() ![]() For example, Xcode must build a custom framework before it builds an app that links against that framework. 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. Xcode builds targets in parallel when it can, but sometimes it must build targets serially. You can now enable sandboxing for shell script build phases using the ENABLE_USER_SCRIPT_SANDBOXING build setting. Apple added a new build setting to Xcode last year, ENABLE_USER_SCRIPT_SANDBOXING, which controls whether any “Run Script” build phases will be run in a sandbox or not.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |