Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.
env
结果如下:
#env switchFrameworks=('aa' 'bb') frameworkFlag='framework' simulatorFrameworkAppendFileName='SimulatorFramework' if [ "${PLATFORM_NAME}" == "iphonesimulator" ]; then for scheme in ${switchFrameworks[@]}; do iphoneosFrameworkPath="${SRCROOT}/Frameworks/${scheme}.${frameworkFlag}" simulatorFrameworkPath="${SRCROOT}/Frameworks/${scheme}${simulatorFrameworkAppendFileName}/${scheme}.${frameworkFlag}" cd ~ if [ ! -d ${scheme} ]; then mkdir ${scheme} cp -r ${iphoneosFrameworkPath} ${scheme} rm -rf ${iphoneosFrameworkPath} cp -r ${simulatorFrameworkPath} "${SRCROOT}/Frameworks/" rm -rf ${simulatorFrameworkPath} fi cd ${SRCROOT} done else for scheme in ${switchFrameworks[@]}; do iphoneosFrameworkPath="${SRCROOT}/Frameworks/${scheme}.${frameworkFlag}" simulatorFrameworkPath="${SRCROOT}/Frameworks/${scheme}${simulatorFrameworkAppendFileName}" cd ~ if [ -d ${scheme} ]; then cp -r ${iphoneosFrameworkPath} ${simulatorFrameworkPath} rm -rf ${iphoneosFrameworkPath} cp -r "$(pwd)/${scheme}/${scheme}.${frameworkFlag}" "${SRCROOT}/Frameworks/" rm -rf ${scheme} fi cd ${SRCROOT} done fi
if [ $CONFIGURATION == Release ]; then echo "Bumping build number..." plist=${PROJECT_DIR}/${INFOPLIST_FILE} #increment the build number (ie 115 to 116) buildnum=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${plist}") if [[ "${buildnum}" == "" ]]; then echo "No build number in $plist" exit 2 fi buildnum=$(expr $buildnum + 1) /usr/libexec/Plistbuddy -c "Set CFBundleVersion $buildnum" "${plist}" echo "Bumped build number to $buildnum" else echo $CONFIGURATION " build - Not bumping build number." fi