Xcode doesn't seem to execute my scheme's post-action

This works on Xcode 5.0, tested, I figure it should work the same in 4.6.2.

Post-actions only works when you quit the program from within the program

It will not run when you click on Stop in Xcode, or terminate the program otherwise. For my case, it works when I press CMD-Q while the program is in focus.

Using a bash script file for Post-actions

These settings work: enter image description here


I suggest you enable logging to a file by adding exec > /tmp/xcode_build.log 2>&1 to the beginning of your run script phase.

You can than see the log by running cat /tmp/xcode_build.log in terminal

This will allow you to print out paths, etc and verify functionality of your scripts.

To print location of the script, you can put following in your post-action:

exec > /tmp/my_log_file.txt 2>&1
pwd

If anyone else comes across this, I was using a script file in my project directory and the file did not have the right permissions for the build process to run the script. I did the following in the pre/post action/Run Script area

chmod 755 ${PROJECT_DIR}/BuildScripts/IncrementBuildNumber.sh
${PROJECT_DIR}/BuildScripts/IncrementBuildNumber.sh

Tags:

Bash

Xcode