Cardinal Mobile SDK comes with both device and simulator architectures in it, so merchants can develop, test their application in both simulator and device. Unfortunately, AppStore does not allow publishing applications with simulator architectures in it. To publish the app into AppStore developer must remove unused(simulator) architectures from binary, to achieve this add below run script at the end in your build phases.
Note: This is only applicable if using CardinalMobile.framework (universal binary) Code Block |
---|
language | applescript |
---|
title | Remove Simulator Architectures |
---|
| FRAMEWORK_NAME="CardinalMobile"
find #FRAMEWORK_EXECUTABLE_PATH is the path where Cardinal framework is located, check Cardinal framework path and update accordingly
FRAMEWORK_EXECUTABLE_PATH="${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/$FRAMEWORK.framework/$FRAMEWORK"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH""$PROJECT_DIR" -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"
if [[ "$EXECUTE_FILE" == *"$FRAMEWORK_NAME"* ]]; then
echo "Executable framework $EXECUTE_FILE"
if $(lipo "$FRAMEWORK/$FILE_NAME" -verify_arch x86_64); then
lipo -remove x86_64 $EXECUTE_FILE -o $EXECUTE_FILE
lipo -info $EXECUTE_FILE
fi
if $(lipo "$FRAMEWORK/$FILE_NAME" -verify_arch i386); then
lipo -remove i386 $EXECUTE_FILE -o $EXECUTE_FILE
lipo -info $EXECUTE_FILE
fi
fi
done |
|