Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i get scheme name in xcode build phase (shell script)

Tags:

xcode

ios

plist

I am trying to get the current scheme name and set it as a value in my plist. I am running the following shells script:

/usr/libexec/PlistBuddy -c "Set :SchemeName \"$SCHEME_NAME\"" "$INFOPLIST_FILE"

The result is that the scheme name is an empty string. If i set some constant string it works perfectly. How can i get the current scheme name?

like image 570
Erik Sapir Avatar asked Apr 08 '26 14:04

Erik Sapir


1 Answers

You can't.

From https://developer.apple.com/library/ios/featuredarticles/XcodeConcepts/Concept-Schemes.html:

An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute.

So this is purely an Xcode interface feature, and it's not part of the build process.

If you want to know for which build configuration (eg. Debug or Release) you're compiling for though, you can use $CONFIGURATION.

like image 182
Guillaume Algis Avatar answered Apr 10 '26 06:04

Guillaume Algis