使用运行脚本检测调试或发布以进行自定义配置

时间:2019-02-17 13:32:52

标签: xcode debugging release run-script

如何通过构建阶段/运行脚本检测调试或发布正在运行?

我有四个自定义配置,每个配置都与发行版或调试版重复。

我找到了这个答案,但是没有用

    if [ "${CONFIGURATION}" = "Release" ]; then
       echo "Relese"
    else 
       echo "Debug"
    fi

2 个答案:

答案 0 :(得分:1)

验证您在方案设置中设置了正确的配置:

scheme settings

通常,在“运行”步骤中将其设置为def count_words(text): """Count how many times each unique word occurs in text.""" counts = dict() # dictionary of { <word>: <count> } pairs to return #counts["I"] = 1 print(text) # TODO: Convert to lowercase lowerText = text.lower() # TODO: Split text into tokens (words), leaving out punctuation # (Hint: Use regex to split on non-alphanumeric characters) split = re.findall(r"[a-z\-]+", lowerText) print(split) # TODO: Aggregate word counts using a dictionary ,但在此屏幕截图中,出于示例的原因,将其设置为Debug。否则您的脚本应该可以工作。

答案 1 :(得分:1)

假设这些是自定义配置:ArrayDequeCustomDebug1CustomDebug2CustomRelease1 像这样的配置应符合条件

CustomRelease2