Distinguishing the MacOS and Mac Catalyst destinations

When using xcodebuild to build my project, I specify a destination of

generic/platform=macOS

Xcode informs me that my destination is ambiguous as there is a generic destination for Mac Catalyst.

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, name:Any Mac }
{ platform:macOS, variant:Mac Catalyst, name:Any Mac }

At the end of the day, that's OK. It's selected the proper destination by happenstance.

But is there a way t change my destination specifier so that it can zero in on the MacOS destination that is not the MacCatalyst variant?

I've tried using "generic/platform=macOS,variant=". But that does not work.

Answered by Systems Engineer in 790094022

There's a hidden macos variant in the non-Catalyst entry. Add ,variant=macos to your destination to select it.

There's a hidden macos variant in the non-Catalyst entry. Add ,variant=macos to your destination to select it.

Distinguishing the MacOS and Mac Catalyst destinations
 
 
Q