OCUnit, NSLog, and XCode 3.1
Asked Answered
A

3

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?

Alcaraz answered 1/7, 2009 at 18:33 Comment(0)
P
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.

Platinic answered 2/7, 2009 at 22:27 Comment(4)
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 ;)Alcaraz
I don't see this button in my build results window in 3.2.1Bracy
The icon changed in 3.2 to be a black/yellow "gdb" icon. Equivalent to the Run / Console menu item (as mentioned by PiPeep).Platinic
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.Reine
F
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.

Fulmar answered 4/8, 2010 at 12:30 Comment(0)
G
-2

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

Graecoroman answered 2/7, 2009 at 22:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.