It’s not a secret, that Xcode can run BASH scripts on some events.

 

But, sometimes when you add your script to Xcode, you don’t think about future modification, git blame, and merge conflict. I hate it. Very.

Xcode screen shot

So in my projects I’m using next way. Add Run Script build phase, but DON’T put your code directly in Xcode text view, you need to create a new file, with extension .sh , add execution permissions via chmod command ( chmod +x .sh), and in your Xcode text view you need just to paste path to your script file:

Or if it in the project’s root directory:

Now every time when you build your project, your script will be executing.

Categories: Useful

Oksana Kovalchuk

Passionate IOS Developer

Related Posts

Debug

Xcode debugging tool – PonyDebugger

Once upon a time Last time when QA comes to me, they want visual debugging tool for our iOS apps. I already researched this subject, and already use CocoaLumberjack tool (with XCodeColors plugin of course), but Read more...

Snippet

Git cloning with sub-modules

For cloning  git repo with submodules, use this command: [crayon-597620030413f729616317/] For already cloned repos, for clone submodules use next command in repo root: [crayon-5976200304145273877459/] And that’s all, Folks. Related

ios

UITextView going crazy…

  Today I stuck with some interesting UITextField behaviour. So when you call: [crayon-597620030421d606666091/] And your current in this moment not visible, for example you don’t use scrolling in textView and text hidden by parent Read more...