Last active
October 14, 2018 15:41
-
-
Save skywinder/7ff35502d4f33e072add to your computer and use it in GitHub Desktop.
Export “fat” Cocoa Touch Framework (for Simulator and Device)
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
#run this script from Product page in your project Derived Data folder | |
framework_name="${$(basename $(find ./Debug-iphoneos -type d -name '*.framework' -maxdepth 1))%.*}" && \ | |
cp -R Debug-iphoneos/$framework_name.framework ./$framework_name.framework && \ | |
lipo -create -output "$framework_name.framework/$framework_name" \ | |
"Debug-iphonesimulator/$framework_name.framework/$framework_name" \ | |
"Debug-iphoneos/$framework_name.framework/$framework_name" |
This code removed bad substitution error.
#run this script from Product page in your project Derived Data folder
framework_name=$(basename $(find ./Debug-iphoneos -type d -name '*.framework' -maxdepth 1) | cut -f 1 -d '.') && \
cp -R Debug-iphoneos/$framework_name.framework ./$framework_name.framework && \
lipo -create -output "$framework_name.framework/$framework_name" \
"Debug-iphonesimulator/$framework_name.framework/$framework_name" \
"Debug-iphoneos/$framework_name.framework/$framework_name"
This did create fat file successfully. However, the .swiftmodule only contains arm64 files. I imported the framework into the project but cannot run in the simulator. It is supported only for a device.
Any suggestions?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I fix the bad substitution error:
framework_name=$(basename
find ./Debug-iphoneos -type d -name '*.framework' -maxdepth 1
| cut -f 1 -d '.') &&cp -R Debug-iphoneos/$framework_name.framework ./$framework_name.framework &&
lipo -create -output "$framework_name.framework/$framework_name"
"Debug-iphonesimulator/$framework_name.framework/$framework_name"
"Debug-iphoneos/$framework_name.framework/$framework_name"