6

I'd been using OCUnit (the default installation that comes with XCode) in XCode 3.0. I've been happy being able to run my tests and see the results in the Build Results window, as well as any NSLog() messages I output.

However, with XCode 3.1 the tests run fine, but I suddenly lose my NSLog() output. Anybody know where it went?

sehugg
  • 3,615
  • 5
  • 43
  • 60

3 Answers3

7

Just learning this stuff myself and had to poke around to answer that very question (XCode 3.1.2).

Go to the Build Results window after running. It may not open automatically, depending on configuration. Build / Build Results menu option will open it if needed.

In the middle area between the two panes, you'll see 4 buttons on the left. The 3rd icon is just 3-4 horizontal lines. Click that to toggle the build transcript. That shows all build steps and NSLog() output from the run.

John M
  • 13,053
  • 3
  • 27
  • 26
  • 1
    What I actually did was make a macro to wrap NSLog() and forgot to #define DEBUG in my Test project. But, I'll give you the answer because most people aren't boneheaded as I am ;) – sehugg Jul 03 '09 at 05:30
  • I don't see this button in my build results window in 3.2.1 – jacob Jan 25 '10 at 00:46
  • The icon changed in 3.2 to be a black/yellow "gdb" icon. Equivalent to the Run / Console menu item (as mentioned by PiPeep). – John M Jan 28 '10 at 00:57
  • Command-Shift-B will take you there as well. And if you build your unit tests once you're already in that window, you shouldn't have to expand anything. In Xcode 3.2 (Snow Leopard) the "show log" button has disappeared, but you can select the *Run custom shell script 'Run Script'* line and click on the little bubble on the right side to expand the unit test log. Works for other build phases as well, such as compilation and linking. – Quinn Taylor Feb 24 '10 at 00:49
3

While it's inconvenient, I found NSLog() messages going to the OSX Console.app.

Applications > Utilities > Console.app I filtered by otest to see output.

I couldn't get any of the above methods to work.

Zach Moazeni
  • 375
  • 2
  • 5
-2

(on the menu-bar) Run -> Console (Shift-Apple-R)

bgw
  • 2,036
  • 1
  • 19
  • 28