iOS only project contains My Mac as run destination

Viewed 2013

After updating to Xcode 11, a framework project, with an iOS only dependency, has started to fail building from command line.

Initially it failed with: error: Building for Mac Catalyst requires macOS 10.15 or later. (in target 'X iOS' from project 'X')

Changing SUPPORTS_MACCATALYST to NO it fails with:

xcodebuild: error: Failed to build project X with scheme X iOS.
    Reason: The run destination My Mac is not valid for Running the scheme 'X iOS'.

And sure enough My Mac is listed in the possible run destinations.

How can I get this removed?

2 Answers

I've had a similar issue. What worked for me was setting:

SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";

As well as setting:

SUPPORTS_MACCATALYST = NO;
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER = NO;

It did not work the first time, but it worked after I switched the Support Mac Catalyst option from NO to YES and back to NO again.

So the culprit turns out to be a test target that had SUPPORTS_MACCATALYST = YES. If just a single target in your project has SUPPORTS_MACCATALYST set to YES then My Mac will show up.

Related