Skip to content

Instantly share code, notes, and snippets.

@Rafal-Prazynski
Last active December 20, 2023 10:27
Show Gist options
  • Save Rafal-Prazynski/74b910fbaaf27540742dac49a84843ff to your computer and use it in GitHub Desktop.
Save Rafal-Prazynski/74b910fbaaf27540742dac49a84843ff to your computer and use it in GitHub Desktop.
RemoveSimulatorArch
find “$PROJECT_DIR/Carthage/Build/iOS” -name ‘*.framework’ -type d | while read -r FRAMEWORK
do
PATH_COUNT=$(echo “$FRAMEWORK/” | grep -o ‘/’ | wc -l)
FILE_NAME=$(echo $FRAMEWORK | cut -d ‘/’ -f $PATH_COUNT | cut -d ‘.’ -f 1)
EXECUTE_FILE=“$FRAMEWORK/$FILE_NAME”
echo $EXECUTE_FILE
if $(lipo $EXECUTE_FILE -verify_arch i386) ; then
lipo -remove i386 $EXECUTE_FILE -o $EXECUTE_FILE
fi
if $(lipo “$FRAMEWORK/$FILE_NAME” -verify_arch x86_64) ; then
lipo -remove x86_64 $EXECUTE_FILE -o $EXECUTE_FILE
fi
lipo -info $EXECUTE_FILE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment