Building a Catalyst project from the command line with xcodebuild?

Not specifically Swift-related per se, but since it's impossible too get any answers on the regular Apple Developers forums :(, I figured I'd ask here:

I cannot see this documented anywhere — has anyone figured our how to use xcodebuild to build an iOS project for UIKIt for Mac (i.e. Catalyst) on the command line?

You can specify "-sdk iphoneos" vs "-sdk iphonesimulator" to toggle between those two targets, but "-sdk uikitformac" does not seem to work ("SDK not found"), despite Xcode itself using that nomenclature (e.g., it builds to a "Debug-uikitformac" folder, etc). i also tried different SDK values that might have made sense (such as "-sdk macabi"), but no avail.

Any ideas? The project I'm trying to build is a library, Mac is enabled in Xcode and the project can be built for UIKit for Mac fine inside Xcode — but I need to build it automatically from our build script, for (for now internal, of course) distribution.

Catalyst is not a separate SDK. I'd try building against the macosx sdk, or iphoneos with the Mac as the destination.

I know under the hood, at the compiler level, xcodebuild is actually building against the macosx SDK, but it's using a target of x86_64-apple-ios13.0-macabi. But I'm not quite sure what the invocation is against xcodebuild.

(It's an old question, but I had to hunt around for the answer to this, so hopefully this is helpful to your or someone else in some way.)

Terms of Service

Privacy Policy

Cookie Policy