Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS only project contains My Mac as run destination

Tags:

xcode

ios

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?

like image 892
mbogh Avatar asked Oct 01 '19 19:10

mbogh


People also ask

Can I run iOS apps on my Mac?

As mentioned, you can only run iOS apps on your Mac if your computer has an Apple Silicon chip. To check if your device is capable, follow these steps below: Click on the Apple logo in the top left corner of your screen. Click on About this Mac.

How to run an app on a device?

Running Your App in the Simulator or on a Device. 1 Choose a Scheme. A scheme is a collection of settings that specify the targets to build, the build configuration, and the executable environment for ... 2 Select a Simulated Device. 3 Select a Real Device. 4 Run the App.

How do I assign my Apple ID to a project?

If you choose a real device, add your Apple ID in Accounts preferences and assign the project to a team on the Signing & Capabilities pane of the project editor. A single individual constitutes a one-person team.


Video Answer


2 Answers

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.

like image 197
mbogh Avatar answered Oct 24 '22 01:10

mbogh


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.

like image 42
ATK Avatar answered Oct 24 '22 02:10

ATK