Search code examples
iosxcodeexit-code

I am trying to return a nonzero exit code on an Xcode Run Script build phase, but it's not working


I have a script in my build phase that I am trying to 'return exit 1' after I throw a build error.

This is coming from a command line tool that is logging 'return exit 1' after there is a problem. The exit 1 shows up on the log, but Xcode still is telling me I need to return a nonzero exit code...

enter image description here

Any ideas? EDIT

Here is the type of script:

enter image description here


Solution

  • Your script is presumably a (bash) shell script. In that case you shouldn't be using return exit 1; you should just be using exit 1.