Xcode crashes when "Build Phases" -> "Copy Files" -> "Copy only when installing" checkbox gets clicked

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.

Thanks for the post, do you reported the Xcode crash already? Do you have the crash file? Would you be so kind to file a bug?

Once you open the bug report, please post the FB number here for my reference.

If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?

Albert Pascual
  Worldwide Developer Relations.

I haven't reported it yet -- honestly, I wasn't even aware of the Feedback Assistant. Nice!

I've filed bug FB16759412.

Thanks!

Xcode crashes when "Build Phases" -> "Copy Files" -> "Copy only when installing" checkbox gets clicked
 
 
Q