This command to build for simulator works just fine with Xcode 14:
xcodebuild \
-project MyProject.xcodeproj \
-scheme App \
-destination "platform=iOS Simulator,name=iPhone 14" \
-derivedDataPath ../../derivedData \
clean build
But on Xcode 15 it gives this error:
MyProject.xcodeproj: error: "App" requires a provisioning profile. Select a provisioning profile in the Signing & Capabilities editor. (in target 'App' from project 'MyProject')
This error is not true. Although I do not have provisioning profiles set up, I do not need them for simulator builds. In fact the Xcode 15 GUI can build this project for simulator just fine without them.
I'm pretty confident that Xcode 15's version of xcodebuild is completely ignoring the -destination argument because I see this warning right before it fails:
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00006000-0008316802D8801E }
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
...
{ platform:iOS Simulator, id:5575F133-1565-4864-882C-78E3EA80F618, OS:17.0, name:iPhone 14 }
Clearly the one I want is in that list. Why does it think it didn't match?
I'm pretty sure this is a bug in Xcode 15. Once I deleted the simulator and recreated it with the exact same name, the same build command worked fine.
I've submitted this bug to Apple as FB13665510.