XcodeGen
XcodeGen copied to clipboard
supportedDestinations doesn't work, all platforms are displayed in Xcode
I am trying to set my target to only support iPhone (iOS). Here is my simple setup:
name: xcodegen-demo
options:
bundleIdPrefix: keke
deploymentTarget:
iOS: 16.2
targets:
xcodegen-demo:
type: application
platform: iOS
# iPad, Mac, and Apple Vision still showing in Xcode
supportedDestinations: [iOS]
sources:
- path: xcodegen-demo
using supportedDestinations: [iOS] doesn't appear to work, after generating the project and opening it in Xcode I can see that all the possible destinations are still available.
Is this a bug or am I doing something wrong?
That's Xcode's default behavior not XcodeGen's. Look at the SDK column, it's all iOS. Compare it with this:
It is indeed Xcode's default when you create a new iOS project, which is why it must have been chosen as a XcodeGen's default when this was implemented. It could be argued that it's not a great default. To control this add these build settings to override the default template:
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD: NO
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD: NO
Let me know if that helps. Closing this for now