xcodebuild segmentation fault

I am getting a segmentation fault with xcodebuild:

2024-06-17 17:08:52.749 xcodebuild[26052:114044] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/m0/fb9pgvx50vngfz_tcpgyxzhw0000gn/T/macnbagent_2024-06-17_17-08-52.747.xcdistributionlogs".
zsh: segmentation fault  /usr/bin/xcodebuild -exportArchive -archivePath  -exportOptionsPlist   

Version:

xcodebuild -version 
Xcode 15.4
Build version 15F31d

Is there any know segmentation fault bug with xcodebuild?

I started to get this yesterday as well, it's been about a month since I had to do the last build.

I'm on Xcode 15.4. I would have been on 15.3 last time I did a release, so I'm downloading that version to test.

I have the same issue. It works without a problem on Xcode 15.3, but fails with "Segmentation fault: 11" on Xcode 15.4.

Here is an example project that reproduces the issue: https://github.com/darrarski/ios-app-export-unsigned-ipa-example

I'm also running into the same issue on macOS Sonoma 14.3 and Xcode 15.4.

Installing the previous Xcode 15.3 fixed the issue.

xcodebuild -version 
Xcode 15.4
Build version 15F31d

I got a similar issue on our CI (Mac mini) during iOS build stage and after checking logs I discovered this trace:

Details: (null) deviceType from XXXXXXXX-XXXXXXXXXXXXXXXX was NULL when -platform called. Object: <DTDKMobileDeviceToken: 0x7fe75d2ec4a0> Method: -platform Thread: <NSThread: 0x600002fee380>{number = 2, name = (null)} Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide. Segmentation fault: 11

The build was failing randomly probably due to the fact that xcodebuild was somehow unavailable to detect or communicate with our iPhone 15 Plus (connected to the Mac mini).

I fixed this issue replacing this original destination parameter:

xcodebuild xxxxxx -destination "platform=iOS"

using the Generic Platform:

xcodebuild xxxxxx -destination "generic/platform=iOS"

Hope it will help some developers struggling with segmentation fault 11 💥.

I am also seeing this when trying to archive with xcodebuild. Xcode Version 15.4 (15F31d).

Can I ask you guys what hardware you're on? I'm seeing the same thing trying to build an app in Fastlane with Intel 2020 chip and Xcode 15.4. I wonder if it's related to the EOL of this chip...?

@baderer I confirm we got the issue on our Mac mini intel, but it did not happened on our Mac Studio.

The fix I mentioned previously with generic platform did work for us.

I don't think this is related to the "EOL" of intel chips, maybe just a bug with Xcode 15.4 and x86 🤷‍♂️.

xcodebuild segmentation fault
 
 
Q