Last active
November 7, 2023 09:41
-
-
Save iTonyYo/6dd5627a7f89ec8a11bde430dfc5dd79 to your computer and use it in GitHub Desktop.
Create xcframework. create this file, and `chmod 755 xcframework.shell` make this file excutable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
iosFrameworksDir="./build/Park.ios.xcarchive/Products/Library/Frameworks" | |
simulatorFrameworksDir="./build/Park.iphonesimulator.xcarchive/Products/Library/Frameworks" | |
outDir="./build" | |
outputSuffix="xcframework" | |
for iosFramework in "$iosFrameworksDir"/* | |
do | |
# Check if the item is a directory | |
if [ -d "$iosFramework" ]; then | |
iosFrameworkName=$(basename "$iosFramework") | |
simulatorFramework="$simulatorFrameworksDir/$iosFrameworkName" | |
if [ -d "$simulatorFramework" ]; then | |
out="$outDir/${iosFrameworkName%.*}.$outputSuffix" | |
# Execute the xcodebuild command for each framework | |
xcodebuild -create-xcframework \ | |
-framework "$iosFramework" \ | |
-framework "$simulatorFramework" \ | |
-output "$out" | |
echo "XCFramework created for ${iosFrameworkName%.*}.$outputSuffix" | |
else | |
echo "Simulator framework not found for $iosFrameworkName" | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment