XCFramework and Mac Catalyst

Hello,


I have archives for all iOS devices working, but when I include archive for macosx the XCFramework works fine in a native MacApp but not with the iOS app including Mac Catalyst.


Here is my xcodebuild statement


xcodebuild archive -project "$FRAMEWORK".xcodeproj -scheme "$FRAMEWORK" \
    -sdk macosx \
    -archivePath "$FRAMEWORK"M.xcarchive SKIP_INSTALL=NO clean


The error I am getting is "While building for Mac Catalyst, no library for this platform was found in '[framework].xcframework


So the question that I have: Is there another -sdk setting to include Mac Catalyst binaries ?


Thank you, your help is appreciated.

Answered by gbacklin in 374124022

With the help of Apple, I got it to work.


xcodebuild archive -project "$FRAMEWORK".xcodeproj -scheme "$FRAMEWORK" \
    -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' \
    -archivePath "$FRAMEWORK"MC.xcarchive SKIP_INSTALL=NO clean
Accepted Answer

With the help of Apple, I got it to work.


xcodebuild archive -project "$FRAMEWORK".xcodeproj -scheme "$FRAMEWORK" \
    -destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' \
    -archivePath "$FRAMEWORK"MC.xcarchive SKIP_INSTALL=NO clean
Alternatively, you can try a command-line tool to create XCFrameworks, check the library line below:

https://github.com/gurhub/surmagic

With this approach, you'll create a file (Surfile) one time only, then you can use it multiple times / forever.

Best
XCFramework and Mac Catalyst
 
 
Q