iosxcodebashbuildxcodebuild

Xcode - How to run script just before build starts


I wonder if there is any way to run scripts before build starts in Xcode. There is way from

Build phase -> Run scripts

But this runs after the actual build is finished. I need to run script before Xcode build starts though.


Solution

  • You need to add a build phase. Go to the project file, Build Phases, click Editor on the tool bar menu, add Build Phase, Add Run Script... You can select and drag the script to put it before/after anything.