Get current Scheme Name from Run Script Phase

后端 未结 3 2049
渐次进展
渐次进展 2021-02-05 04:41

Is there a way of grabbing the current scheme from a run script phase?

I\'ve tried $(SCHEME_NAME) but it doesn\'t exist.

3条回答
  •  眼角桃花
    2021-02-05 05:28

    INTERMEDIATES_OUTPUT_DIR doesn't seem to work for building swift previews which I wanted customization on as well. I ended up doing something similar using defaults write which I found works in all cases and doesn't involve the creation of a file.

    Prebuild:

    defaults write com.apple.dt.Xcode LastBuildScheme "MySchemeName"`
    

    Build Script:

    [[ $(defaults read com.apple.dt.Xcode LastBuildScheme) = "MySchemeName" ]] && echo "Scheme" || echo "Not Scheme"
    

提交回复
热议问题