NOTE :- BUILD iOS SIMULATOR & iPHONE OS .framework FROM XCODE BUILD OPTION FIRST.
#1. After then make a fresh directory directory
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
2. Copy Device(arm64) Framework at fresh universal folder location
cp -a "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/"
#3. Copy Sim(x86_64) Frameworks's "MyFramework.swiftmodule" Folder Content & paste it at Fat(x86_64 + arm64) Frameworks's "MyFramework.swiftmodule" folder.
SIMULATOR_SWIFT_MODULES_DIR="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule/."
if [ -d "${SIMULATOR_SWIFT_MODULES_DIR}" ]; then
cp -R "${SIMULATOR_SWIFT_MODULES_DIR}" "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule"
fi
Step 4. Create universal binary file using lipo and place the combined executable in the copied framework directory
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}"
Step 5. Copy output at Project Directory
cp -R "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}"
Step 6. Open Project Directory
open "${PROJECT_DIR}"
7. Don’t Forget to remove x86_64 Simulator Architecture from your “Universal Framework “ before uploading it on App Store(will not allow):-
lipo -remove x86_64 MyFramework -o MyFramework
Thanks!
Go Slow, Speed will come automatically!!
Mail Me:
iOSCoderAbhimanyuDaspan@gmail.com
Twitter
/ daspanabhimanyu
Facebook
/ abhimanyu.daspan.7
Instagram
/ ioscoderabhimanyudaspan
Youtube
/ @ioscoderabhimanyudaspan8269
Github:-
https://github.com/AbhimanyuForiOS
LinkedIn
/ abhimanyu-singh-rathore-daspan-🇮🇳-77677098
On this page of the site you can watch the video online Advanced iOS : Part 2 - Universal Framework (.framework) in iOS Through Xcode Shell Script. with a duration of hours minute second in good quality, which was uploaded by the user iOSCoderAbhimanyuDaspan 04 March 2021, share the link with friends and acquaintances, this video has already been watched 2,089 times on youtube and it was liked by 41 viewers. Enjoy your viewing!