Skip to content

Instantly share code, notes, and snippets.

@osamaqarem
Created January 7, 2021 03:24
Show Gist options
  • Save osamaqarem/fd03d22a30711969e2677bf97f5a5111 to your computer and use it in GitHub Desktop.
Save osamaqarem/fd03d22a30711969e2677bf97f5a5111 to your computer and use it in GitHub Desktop.
Building XCFramework
#!/bin/bash
user=$(id -un)
rm -rf ProjectName.xcframework && \
xcodebuild archive \
-workspace ProjectName.xcworkspace \
-scheme ProjectName \
-destination "generic/platform=iOS" \
-archivePath "archives/ios" \
SKIP_INSTALL=NO \
SWIFT_SERIALIZE_DEBUGGING_OPTIONS=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES && \
xcodebuild archive \
-workspace ProjectName.xcworkspace \
-scheme ProjectName \
-destination "generic/platform=iOS Simulator" \
-archivePath "archives/ios-sim" \
SKIP_INSTALL=NO \
SWIFT_SERIALIZE_DEBUGGING_OPTIONS=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES && \
xcodebuild -create-xcframework \
-framework archives/ios.xcarchive/Products/Library/Frameworks/ProjectName.framework \
-debug-symbols /Users/$user/Developer/ProjectName/archives/ios.xcarchive/dSYMs/ProjectName.framework.dSYM \
-framework archives/ios-sim.xcarchive/Products/Library/Frameworks/ProjectName.framework \
-debug-symbols /Users/$user/Developer/ProjectName/archives/ios-sim.xcarchive/dSYMs/ProjectName.framework.dSYM \
-output ProjectName.xcframework && \
cd Demo && pod install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment