Xcode 11 archive gives PhaseScriptExecution failed

前端 未结 4 850
小鲜肉
小鲜肉 2021-01-04 21:59

After I migrate my project from swift 3.2 to swift 4 in Xcode 10 I try to archive in Xcode 11 and give me this error:

PhaseScriptExecution Run\\ Scrip

4条回答
  •  醉梦人生
    2021-01-04 22:08

    Here is the script that worked for me on Xcode 11+
    Just add a new Run Script Phase to your Build Phases
    Add it below the Link Binary with Libraries phase.

    #!/bin/sh
    
    # To make executable, use: chmod u+x Build-Versioning-Scripts/Increment_Build_Number.sh
    # to locate your target's info.plist use
    # ${PRODUCT_SETTINGS_PATH}
    
    echo "----"
    echo "Info.plist for target: ${PRODUCT_SETTINGS_PATH}"
    
    buildNum=$(/usr/libexec/Plistbuddy -c "Print CFBundleVersion" "${PRODUCT_SETTINGS_PATH}")
    echo "Current build #: $buildNum"
    
    if [ -z "$buildNum" ]; then
    echo "No build number found in $PRODUCT_SETTINGS_PATH"
    exit 2
    fi
    
    buildNum=$(expr $buildNum + 1)
    echo "Build # incremented to: $buildNum"
    /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNum" "$PRODUCT_SETTINGS_PATH"
    echo "----"
    exit 0 
    

    This script was originally posted here by Alex Zavatone.

    Hope this helps

提交回复
热议问题