Xcode Shell script call failed: command / bin / sh failed with exit code 127

I got a shell script invocation error:

The / bin / sh command failed with exit code 127

when trying to archive my project. I was able to build normally without a shell script if I checked "Run the script only during installation" in the build phases. Archiving has become a problem with or without build phases. Permanent error.

+4
source share
1 answer

Three years ago to this question and a reminder from the end of March this year. Ok, I will bite.

In general, the shell script ends with the exit code you want. Therefore, if your script contains:

exit 127 

This will probably be the reason for the exit code.

However, certain exit codes are standard, and it is generally considered bad to use them. (the table below is not exhaustive)

 +----+--------------------------------------------------------+ | 1 | Catch-all for general errors, eg divide by zero etc. | +----+--------------------------------------------------------+ | 2 | Misuse of shell build-ins | +----+--------------------------------------------------------+ | 126| Cannot execute command invoked | +----+--------------------------------------------------------+ | 127|Illegal command/command not found | +----+--------------------------------------------------------+ | 128|Illegal argument to exit (eg exit 3.14) | +----+--------------------------------------------------------+ 

So, if there is no exit 127 in the script, this is probably an illegal command. Does /bin/sh exist? (sounds trivial, but I saw systems where they do not exist). What does the script say when starting manually?

0
source

Source: https://habr.com/ru/post/1495340/


All Articles