Skip to content

Instantly share code, notes, and snippets.

@vineetchoudhary
Created July 2, 2018 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vineetchoudhary/f6d2dc82f16e68bd931a3e42ff264672 to your computer and use it in GitHub Desktop.
Save vineetchoudhary/f6d2dc82f16e68bd931a3e42ff264672 to your computer and use it in GitHub Desktop.
Build script which use to create a multi-architecture shared library that will work on an iOS device and the simulator for the any library. (Xamarin.iOS)
#xcodebuild location
XBUILD=/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
#Project root
PROJECT_ROOT=/Volumes/LongTime/Shared/RESideMenu/
#Complete Project Path
PROJECT=/Volumes/LongTime/Shared/RESideMenu/RESideMenu.xcodeproj
#Target Name
TARGET=RESideMenu
#build for i386 (iPhone Simulator)
${XBUILD} -project ${PROJECT} -target ${TARGET} -sdk iphonesimulator -configuration Release clean build
mv ${PROJECT_ROOT}/build/Release-iphonesimulator/lib${TARGET}.a ${PROJECT_ROOT}/lib${TARGET}-i386.a
#build for arm64.a (iPhone)
${XBUILD} -project ${PROJECT} -target ${TARGET} -sdk iphoneos -arch arm64 -configuration Release clean build
mv ${PROJECT_ROOT}/build/Release-iphoneos/lib${TARGET}.a $PROJECT_ROOT/lib${TARGET}-arm64.a
#build combine i386 and arm64
xcrun -sdk iphoneos lipo ${PROJECT_ROOT}/lib${TARGET}-i386.a ${PROJECT_ROOT}/lib${TARGET}-arm64.a -create -output ${PROJECT_ROOT}/lib${TARGET}.a
#Check arch
xcrun -sdk iphoneos lipo -info lib${TARGET}.a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment