Had a discussion with the build systems team at WWDC25 about this. The reason they gave that we can not differentiate the preview build from regular builds, is that they are practically the same. They use the same build process, caches, etc. so there is no meaningful way to distinguish them.
The recommended solution here is to avoid changing files during the build if at all possible. For example, a formatter should be run with auto-correction disabled during build phase scripts. One way to achieve auto-correction would be to leverage git-hooks to run the formatter before your code is pushed.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: