- 
      
- 
        Save skywinder/7ff35502d4f33e072add to your computer and use it in GitHub Desktop. 
| #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" | 
bad substitution error. Any suggestion?
this http://stackoverflow.com/a/26691080/1994889 solution works well in my case
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"
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?
Error
-bash: ${$(basename $(find ./Debug-iphoneos -type d -name '*.framework' -maxdepth 1))%.*}: bad substitution