turn on Build libraries for distribution
Use the following commands from root directory
Here My Framework name is WeavrComponents, replace that with yours
xcodebuild archive \
-workspace WeavrComponents.xcworkspace \
-scheme WeavrComponents \
-configuration Release \
-destination 'generic/platform=iOS' \
-archivePath './build/WeavrComponents.framework-iphoneos.xcarchive' \
SKIP_INSTALL=NO \
BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild archive \
-workspace WeavrComponents.xcworkspace \
-scheme WeavrComponents \
-configuration Release \
-destination 'generic/platform=iOS Simulator' \
-archivePath './build/WeavrComponents.framework-iphonesimulator.xcarchive' \
SKIP_INSTALL=NO \
BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
and add
xcodebuild archive \
-workspace WeavrComponents.xcworkspace \
-scheme WeavrComponents \
-configuration Release \
-destination 'platform=macOS,arch=x86_64,variant=Mac Catalyst' \
-archivePath './build/WeavrComponents.framework-catalyst.xcarchive' \
SKIP_INSTALL=NO \
BUILD_LIBRARIES_FOR_DISTRIBUTION=YES
xcodebuild -create-xcframework \
-framework './build/WeavrComponents.framework-iphonesimulator.xcarchive/Products/Library/Frameworks/WeavrComponents.framework' \
-framework './build/WeavrComponents.framework-iphoneos.xcarchive/Products/Library/Frameworks/WeavrComponents.framework' \
-output './build/WeavrComponents-1.0.xcframework'
xcodebuild -create-xcframework \
-framework './build/WeavrComponents.framework-iphonesimulator.xcarchive/Products/Library/Frameworks/WeavrComponents.framework' \
-framework './build/WeavrComponents.framework-iphoneos.xcarchive/Products/Library/Frameworks/WeavrComponents.framework' \
-framework './build/WeavrComponents.framework-catalyst.xcarchive/Products/Library/Frameworks/WeavrComponents.framework' \
-output './build/WeavrComponents.xcframework'