This exact case happened when going from Xcode 15.0.1 to Xcode 15.1. However, it can occur on any command line xcodebuild invocation in which a Simulator device is removed from Xcode for the latest iOS. The error message at the bottom is somewhat misleading when trying to arrive at the root cause.
Further up in the log, you will see this warning.
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00006001-001460CE1A45801E }
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:iOS Simulator, id:03FE7456-3AAA-4060-A403-A0A90E8DE31A, OS:15.0, name:iPad (9th generation) }
{ platform:iOS Simulator, id:03FE7456-3AAA-4060-A403-A0A90E8DE31A, OS:15.0, name:iPad (9th generation) }
And so on...
Another thing to keep in mind is that the destination parameter has default values for its sub-parameters. From the xcodebuild man page:
When specifying the simulated device by name, the iOS version for that simulated device, such as 6.0, or the string latest (the default) to indicate the most recent version of iOS supported by this version of Xcode.
My invocation was asking for the latest iOS version on iPhone 14. The latest iOS in Xcode 15.1 is iOS 17.2. My Mac has Simulators left over from older Xcode installations and iPhone 14 is available but it only goes up to iOS 17.0.1. Therefore, my invocation was asking for an impossible device combo. Xcode 15.1 has an iPhone 15 at iOS 17.2, not an iPhone 14.
Instead of reporting an error and failing there, xcodebuild only logs a warning and then picks the first available destination. Because my Mac has an Apple silicon CPU, and because of the feature Apple calls “Designed for iPhone or Designed for iPad”, it is possible to run my iOS app directly in macOS. Unfortunately, the first destination in the list will attempt to run the app on my Mac itself but not in an iOS Simulator. Since it is trying to run on a real device, of course, it expects that real device to be registered in a provisioning profile. And that’s how the misleading error message shows up.
The fix was to update our scripts to invoke xcodebuild with a destination parameter containing iPhone 15 instead of iPhone 14 starting with Xcode 15.1.




