Take the 2-minute tour ×

How can I see the output from the compiler of from the custom build steps (pre-action or post-action)?

share|improve this question
add comment

4 Answers

up vote 9 down vote accepted

Pre-action output at least appears in system.log and is visible in Console.app.

share|improve this answer
+1. I have been looking at the Log Navigator, but was unable to see my echo's being outputted. Then I checked Console.app and I now see them listed there. So Console.app works. –  neoneye Jul 16 '11 at 9:41
add comment

So I figured out a way to both:

  1. Show output from pre-build scripts
  2. Stop the build script in the case of a build error

The basic concept is to send all output from the build event to various files, and then present that output as a part of a target build script (which does show it's output and can be exited or canceled).

Warning Hacks be near

Setup a build script that automagically handles pumping the output to 2 different files... 1 for the regular logs, and one for stderr. Or use mine (I posted on my blog because it seems stack overflow code detection sucks at shell scripts.)

Then you should call that script in the scheme prebuild phase like so:

"${PATH_TO_LOG_SCRIPT}/log_prebuild.sh" "${PATH_TO_PREBUILD_SCRIPT_TO_EXECUTE}/scriptToExecute.sh" 2> "${SOURCE_ROOT}/build/prebuild_error.log"

Then you need to setup a script in prior to the compile phase in the target build phases that checks for the presence of those files, dumps them to the logs, and interrupts the build if there was a failure. Or you could again use mine

Then build and cross your fingers :)

share|improve this answer
add comment

Per my answer here ( Is it normal for xcode not to detect if a pre-action failed? ) this is an issue that's been discussed in the dev forums. Pre-/post-action script non-zero status doesn't seem to have an affect, nor does the output seem to make it into any logs.

share|improve this answer
I was not able to find any discussion about this on the devforum, but I added a new tread devforums.apple.com/message/427106#427106 –  sorin May 3 '11 at 8:05
add comment

You'll find (and you can watch during the build) the complete build output in the Log Navigator. That's the right most icon of the small icons just below the Run and Build buttons.

share|improve this answer
Thanks for giving me this hint, the only problem is that I do not see anything reffering to the pre-action or post-action for build. I included and echo on the shell script and I do not see it. –  sorin Mar 24 '11 at 16:44
Thanks for posting this. I was trying to find the item by item build results ala xcode 3 and this is about as close as you get. –  TahoeWolverine May 25 '11 at 20:28
Log Navigator output doesn't include output from Scheme "Run Script" pre-actions. As Jonah notes it can be seen in Console.app –  daver Aug 24 '12 at 6:14
For anyone who can't find the raw compiler output simply by "showing" the Log Navigator: With the Log Navigator showing, there should be a list of overall steps, in XCode format, with check marks next to them, in the main pane. Find the step of interest (in mine, it says "compile main.cpp"). Click on it. To the very right, will appear a tiny little icon that looks like a text file. Click on this, to finally reveal the %&^%* compile output. –  Dan Nissenbaum Dec 13 '13 at 21:58
add comment

Your Answer


