Uploaded by Диана Агапкина

Building XCFramework

advertisement
‼
Building XCFramework
Archive
Considering we want to create XCFramework of SAPImageAnnotation.
Prepare output folder, for example ~/Downloads/xcframework.
Open the terminal. Select folder with project (cd /projectPath).
. Create archive for iOS platform by running command below:
2
xcodebuild archive \
-scheme SAPImageAnnotation \
-destination "generic/platform=iOS" \
-archivePath ~/Downloads/xcframework/SAPImageAnnotation-iOS \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
WHERE:
– scheme: Name of SDK
– destination: Platform name
– archivePath: path to output folder. For iOS platform add ‘-iOS’
. Create archive for iOS Simulator by changing destination to ‘generic/
platform=iOS Simulator’ and add ‘-Sim’ to archivePath as below:
xcodebuild archive \
-scheme SAPImageAnnotation \
-destination "generic/platform=iOS Simulator" \
-archivePath ~/Downloads/xcframework/SAPImageAnnotation-Sim \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
1
NOTE: Don’t forget to exclude arm64 architecture before you archive
for iOS Simulator if necessary.
Create XCFramework
In terminal, cd to output folder where you now have two archives for iOS
and iOS Simulator.
Run following command:
xcodebuild -create-xcframework \
-framework ./SAPImageAnnotation-iOS.xcarchive/Products/Library/
Frameworks/SAPImageAnnotation.framework \
-framework ./SAPImageAnnotation-Sim.xcarchive/Products/Library/
Frameworks/SAPImageAnnotation.framework \
-output ./SAPImageAnnotation.xcframework
Download