Xcode embeds the script in the project file when [adding Run Script Build Phase](https://developer.apple.com/library/ios/recipes/xcode_help-project_editor/Articles/AddingaRunScriptBuildPhase.html), but I think you could execute an external script with something like this:

    #!/bin/bash
    sh $PROJECT_DIR/scripts/addBuildVersion.sh