AppStore Issues while submitting App to AppStore

2019-09-05 03:24发布

问题:

I got the same issue as below Submit to App Store issues: Unsupported Architecture x86

But need help to adjust my shell script below for sdk.

    set -e

    FRAMEWORK_NAME="SDK"
    OUTPUT_PATH="${SRCROOT}"

    if [ -d "${SRCROOT}/build" ]; then
    rm -rf "${SRCROOT}/build"
    fi

     xcodebuild -target "${FRAMEWORK_NAME}" -configuration Release -arch 
     arm64 -arch armv7 -arch armv7s only_active_arch=no defines_module=yes 
    -sdk "iphoneos"
    xcodebuild -target "${FRAMEWORK_NAME}" -configuration Release -arch 
    x86_64 -arch i386 only_active_arch=no defines_module=yes -sdk 
    "iphonesimulator"

    if [ -d "${OUTPUT_PATH}/${FRAMEWORK_NAME}.framework" ]; then
    rm -rf "${OUTPUT_PATH}/${FRAMEWORK_NAME}.framework"
    fi

    cp -r "${SRCROOT}/build/Release-iphoneos/${FRAMEWORK_NAME}.framework" 
    "${OUTPUT_PATH}/${FRAMEWORK_NAME}.framework"

    lipo -create -output 
    "${OUTPUT_PATH}/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" 
    "${SRCROOT}/build/Release- 
    iphoneos/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}" 
    "${SRCROOT}/build/Release- 
    iphonesimulator/${FRAMEWORK_NAME}.framework/${FRAMEWORK_NAME}"

    cp -r "${SRCROOT}/build/Release- 

  iphonesimulator/${FRAMEWORK_NAME}.framework/Modules/${FRAMEWORK_NAME}.swif tmodule/" "${OUTPUT_PATH}/${FRAMEWORK_NAME}.framework/Modules/${FRAMEWORK_NAME}.swiftmodule"

    if [ -d "${SRCROOT}/build" ]; then
    rm -rf "${SRCROOT}/build"
    fi

I have script in App side is below for removing unwanted Arch. I think it's removing all unwanted Arch but it's not when I building it's failing with error Release-iphonesimulator is missing..

if [ "$CONFIGURATION" == "App Store" ]; then
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"

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
fi
标签: ios xcode