I've got a very simple command-line Swift project that contains a couple of OpenGL shader source files. They need to be accessed at run-time in order to be compiled and linked.
For initial debugging, I hard-coded the absolute path to their location in the Xcode project directory, but I switch back and forth between two machines (MacBook Pro and Mac Studio) for which the project paths are different, so this doesn't work well.
To solve this, I thought I could get Xcode to copy the shader sources over with the executable file at build time.
I'm aware that technically, command-line apps have no resource bundle, but the "Build Phases" -> "Copy Files" section of the project configuration isn't disabled for my project, so I assumed that it could handle this.
I added the two shader source files to the set of files to copy, via the "+" button, and set the Destination to "Products Directory". I left the "Subpath" field blank.
AFAICT, nothing happens: the "Products/Debug" sub-directory of "~/Library/Developer/Xcode/DerivedData/..." has the executable, but neither of the shader sources. In fact, they don't appear anywhere inside ~/Library/Developer/Xcode.
Okay, perhaps I need to uncheck "Copy only when installing" in the project config?
Sadly, as soon as I click to uncheck it, Xcode crashes, even if that's the very first thing I do immediately after Xcode restarts.
FWIW, I'm running Xcode 16.2 on a late 2019 MacBook Pro running Sonoma 14.6.1, but I'm pretty sure I've experienced the problem on my 2024 Mac Studio as well.