Thanks for the suggestion @NeoNacho, but it doesn't work, at least not with iOS as a destination. The output of the xcodebuild archive
command is not a *.framework
, just object file(s).
You script, modified for iOS, expects that xcodebuild archive
creates tmp/iOS.xcarchive/Products/usr/local/lib/Emoji.framework
, but that does not happen. What happens is that following is created: tmp/iOS.xcarchive/Products/Users/srdan/Objects/Emoji.o
NAME="Emoji"
mkdir -p tmp
xcodebuild archive -workspace $NAME.xcworkspace -scheme $NAME \
-destination "generic/platform=iOS" \
-archivePath "tmp/iOS" \
SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
MODULES_PATH="tmp/iOS.xcarchive/Products/usr/local/lib/$NAME.framework/Modules"
mkdir -p $MODULES_PATH
DERIVED_DATA="`ls -d $HOME/Library/Developer/Xcode/DerivedData/$NAME-*`"
BUILD_PRODUCTS_PATH="$DERIVED_DATA/Build/Intermediates.noindex/ArchiveIntermediates/$NAME/BuildProductsPath"
cp -a $BUILD_PRODUCTS_PATH/Release-iphoneos/$NAME.swiftmodule $MODULES_PATH