It seems the scheme name isn't available in the build phase scripts.
You have $CONFIGURATION environment variable, but that is just the build configuration (set in Edit scheme > Info), e.g. Debug or Release. But many schemes can have the same build configuration.
It might suit you to create a new build configuration just for a specific scheme, duplicated from an existing build configuration. I did this when I had a Staging scheme which needed specific tweaks in my custom build-phase script.
How to create a new build configuration...
- Select your project in the XCode navigator (the main left hand pane that looks like a file tree).
- Select your project in the little pane that shows you your project and its targets. If you've selected a target you can't add a configuration.
- Tap the Info tab > Configurations >
+ button and pick a configuration to duplicate.
Once you have that you can go edit your scheme and change its build configuration to the new one. Then your scripts will know it's using that scheme.