Submitting apps to the App Store with Dynamic Libraries

I was trying to submit a proof of concept app to the app store for TestFlight distribution. Submission failed.
Looked up Mapbox to see if there was a new version. No.
Looked up Mapbox to see if I was missing something in their instructions. No
A quick google search, lead me to a stack overflow post, which linked to another, which linked to this: Stripping Unwanted Architectures From Dynamic Libraries In Xcode
Copy, paste,

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

# This script loops through the frameworks embedded in the application and
# removes unused architectures.
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"

    EXTRACTED_ARCHS=()

    for ARCH in $ARCHS
    do
        echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
        lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
        EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
    done

    echo "Merging extracted architectures: ${ARCHS}"
    lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
    rm "${EXTRACTED_ARCHS[@]}"

    echo "Replacing original executable with thinned version"
    rm "$FRAMEWORK_EXECUTABLE_PATH"
    mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"

done

(might need to follow step 0 from here)
Archive, submit.
Upload Successful

Xcode Run Script to Auto-increment Build Number

Auto-incrementing build number.

  • 0. Target -> Build Phases -> Target Dependencies. Click on “Add target dependencies here” area (Xcode bug to get step 1 not greyed out)
  • 1. Editor -> Add Build Phase -> Add Run Script Build Phase
  • 2. Paste this code
  • 3. Change CFBundleDisplayName prefix. eg. Ped
  • 4. Add Row Bundle display name (aka CFBundleDisplayName) to Info.plist
# 0. Target -> Build Phases -> Target Dependencies. Click on "Add target dependencies here" area (Xcode bug to get step 1 not greyed out)
# 1. Editor -> Add Build Phase -> Add Run Script Build Phase
# 2. Paste this code
# 3. Change CFBundleDisplayName prefix. eg. Pedometer
# 4. Add Row "Bundle display name" (aka CFBundleDisplayName) to Info.plist

#!/bin/bash
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
/usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName Ped $buildNumber" "$INFOPLIST_FILE"