Skip to content

Instantly share code, notes, and snippets.

@imbears
imbears / Remove_unsupported_archetypes.sh
Created May 14, 2025 07:02 — forked from Bengejd/Remove_unsupported_archetypes.sh
XCode - Build Phase Script - Remove unsupported archetypes ( simulator x86_64 & i386) from frameworks on build.
# This removes the unsupported archetypes from frameworks on the build phase.
echo "Target architectures: $ARCHS"
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"