I have the following script saved as a Run Script in my project's target:
git_output=$(git status | grep "nothing to commit, working directory clean")
if [[ -z "$git_output" ]]; then
xcrun agvtool next-version -all
fi
Which checks the git repo to see if there are any pending changes, and if so increments the project's build number. That all works fine.
The problem is that when running KIF tests, the changing of the build number messes with the running of the KIF tests so that it never ends up launching the simulator and running. I have verified that if no such build number increment occurs, the KIF test will run just fine.
The easiest way to go about this would to specify within Xcode to not run a given script when running a certain scheme. Additionally, if I could query which scheme is being run from within the script itself, that would accomplish the same thing. But I am unaware how to do either of those.