Is there a way of grabbing the current scheme from a run script phase?
I\'ve tried $(SCHEME_NAME)
but it doesn\'t exist.
You can write the scheme name to the info.plist
file and read it back in Run Script Phase, in Edit Scheme menu, choose Build -> Pre-actions and add the following script:
/usr/libexec/PlistBuddy -c "Set :SchemeName \"$SCHEME_NAME\"" "$INFOPLIST_FILE"
and then add the key SchemeName
of type string in the info.plist
, and its initial value is empty.
Finally, in the run script phase add the following:
SCHEME_NAME=$(/usr/libexec/PlistBuddy -c "Print SchemeName" "$INFOPLIST_FILE")