Xcode build tools producing empty dSYM file

Hello!

I’m currently trying to build my iOS project from the command line including all symbols with dSYMs. Some information about my project:

I have two different targets in addition to libraries imported with a mix of Cocoapods and SwiftPM The debug information format for all targets is “DWARF with dSYM File” The issue I’m having is that after dSYM files are created, there is one empty one. The empty one always ends up being the actual app’s dSYM file. So the second target and all dependency dSYM files are created successfully, but the main app dSYM file is completely empty. Strangely, it works properly in about 1 out of every 20 builds.

I’m building the app with the following command: 
 xcodebuild clean archive -workspace $WORKSPACE/workspaceName -scheme “appName-$ENV" -archivePath $WORKSPACE/build/xcarchive name -destination 'generic/platform=iOS' || exit 1

I run the build command from a build server that uses Jenkins. When I run this locally, or build from Xcode, this problem does not occur. It seems to be isolated to only the build server.

Xcode version: 14.3 MacOS version: 13.3.1

Any suggestions on why this might be happening?

Xcode build tools producing empty dSYM file
 
 
Q