Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Toggle run script build phase in Xcode

I have a run script build phase I have added to an Xcode project.

I want to be able to toggle this run script on when I want it to run and off when I don't.

Is this possible in Xcode and if so how can it be done?

like image 440
Mike Avatar asked Nov 20 '14 19:11

Mike


1 Answers

I used to write exit in the first line to toggle off the script and #exit to toggle on, just like this:

Turn off a script e.g. SwiftLint:

exit
if which swiftlint >/dev/null; then
  swiftlint
else
  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

Turn on:

#exit
if which swiftlint >/dev/null; then
  swiftlint
else
  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

You just have to modify 1 character whether exit is commented out or not.

like image 63
balazs630 Avatar answered Oct 28 '22 19:10

balazs630