I can't seem to find a way to have the console run (to show NSLog comments) in XCode 4. The normal method for the previous version of XCode does not work. Does anyone have an idea of how to accomplish this?
-
2There is a whole forum on the ADC site for these sorts of questions where the NDA doesn't apply, you know? You might get more help there. – Abizern Aug 05 '10 at 21:31
-
Although this will only show the console, this will not keep it open. Please see the answers by Andreas and Holli below for the correct solution to this problem. You can do this is Preferences > Alerts > Run completes > Uncheck "Hide debugger" – Debajit Jan 30 '11 at 00:10
-
I found this solution to be much better, AND it is much more like previous versions of XCode: http://stackoverflow.com/questions/5306276/xcode-4-detach-the-console-log-window – MStudios May 04 '11 at 15:39
8 Answers
You need to click Log Navigator icon (far right in left sidebar). Then choose your Debug/Run session in left sidebar, and you will have console in editor area.

- 1,861
- 1
- 17
- 32

- 2,272
- 1
- 14
- 15
-
Just a note, that icon is at the very very bottom right of the search bar that is in the same ribbon as the step over, step into, etc. – Alex Barker Apr 04 '13 at 20:49
-
Had to click on the hamburger (horizontal lines) icon in the main panel to see the actual console output in full – Peter Ehrlich Jul 01 '14 at 03:05
-
2
If you just want to have the log output display when you run your app then you can go into XCode4 preferences -> Alerts and click on 'Run starts' on the left hand column.
Then select 'Show Debugger' and when you run the app the NSLog output will be displayed below the editor pane.
This way you don't have to select on the 'up arrow' button at the bottom bar.

- 486
- 5
- 3
The console is no extra window anymore but it is under the texteditor area. You can set the preferences to always show this area. Go to "General" "Run Start" and activate "Show Debugger". Under "Run completes" the Debugger is set to hide again. You should deactivate that option. Now the console will remain visible.
EDIT
In the latest GM Release you can show and hide the console via a button in the toolbar. Very easy.

- 13,407
- 27
- 102
- 147
Here' an alternative
In Xcode 4 short cut to display and hide console is (command-shift-Y) , this will show the console and debugger below ur text edior in the same window.

- 158
- 1
- 8
You can always see the console in a different window by opening the Organiser, clicking on the Devices tab, choosing your device and selecting it's console.
Of course, this doesn't work for the simulator :(

- 38,189
- 13
- 98
- 110
-
jshier's answer in [this question](http://stackoverflow.com/questions/5306276/xcode-4-detach-the-console-log-window) tells how to do what you're talking about for the simulator. – funroll Nov 06 '12 at 15:35
There's two options:
Log Navigator (command-7 or view|navigators|log) and select your debug session.
"View | Show Debug Area" to view the NSLog output and interact with the debugger.
Here's a pic with both on. You wouldn't normally have both on, but I can only link one image per post! https://i.stack.imgur.com/4gG4P.png

- 2,562
- 1
- 18
- 35
Here's an alternative.
- In XCode4 double-click your Project (Blueprint Icon).
- Select the Target (Gray Icon)
- Select the Build Phases (Top Center)
- Add Build Phase "Run Script" (Green Plus Button, bottom right)
- In the textbox below the Shell textfield replace "Type a script or drag a script file from your workspace" with "open ${TARGET_BUILD_DIR}/${TARGET_NAME}"
This will open a terminal window with your command-line app running in it.
This is not a great solution because XCode 4 still runs and debugs the app independently of what you're doing in the terminal window that pops up.

- 31
- 1