21

I was happily printlning to the Console Output in the Assistant Editor of a Swift/Xcode 6 Playground (see this SO thread for more info), until I decided to try clicking the [X] to close the Console Output.

How do I bring the Console Output back??

Community
  • 1
  • 1
ericsoco
  • 24,913
  • 29
  • 97
  • 127

9 Answers9

28

This eluded me for a while, too. You want View menu -> Assistant Editor -> Show Assistant Editor.

Once you see the pane that holds the console output, if you still aren't seeing the right thing, make any change that will cause a println() to fire and the console output should appear.

Nate Cook
  • 92,417
  • 32
  • 217
  • 178
  • Nope. Doesn't bring back the Console Output...I can add more and more `println`s but see nothing. – ericsoco Jun 18 '14 at 05:53
  • So...all of these answers now work for me. Must have managed to get Xcode into a bad state that required a restart. I'm accepting this one since it was here first :) – ericsoco Jun 22 '14 at 21:54
  • I can only see blank lines when I use `println`, so I've had to `import UIKit` and use `NSLog` for now.. – Batnom Jul 15 '14 at 06:43
  • Same problem here. Nothing will bring back the console once pressing the little cross. Perhaps a bug in swift? – Kokodoko Jul 23 '14 at 18:54
  • 1
    @ericsoco this is actually caused by an error in the code. when you reopen a playground, if there is any error in the code, it won't show any output. try commenting out portions of you code until output returns. – Soup Sep 03 '14 at 04:52
  • In Xcode 6.3 and later, including Xcode 7 Beta, console output appears in the Debug area at the bottom of the playground window (similar to where it appears in a project). Here is full answer for XCode 6/7 -> http://stackoverflow.com/questions/24003092/how-to-print-to-console-using-swift-playground – CTiPKA Oct 07 '15 at 09:25
5

Just hover your mouse pointer over the value evaluation area (pane next to your coding area) and click on the plus sign to open the output pane. If you have closed the console output in the output pane, then click anywhere in the coding area and press enter. You will get your console output back. enter image description here

Abbyjeet
  • 89
  • 5
  • I did same, many times but it's not working. It's showing under the code, but I want it to show on the right (Assistant Editor). – Emm Mar 23 '17 at 21:16
4

If the View > Assistant Editor > Show Assistant Editor does not work, simple go to the bottom of the screen and drag the little footer up, so it looks like so:

enter image description here

LeviXC
  • 1,075
  • 2
  • 15
  • 32
3

Closing the Playground and reopening did not bring the Console Output back, but quitting Xcode and reopening did. If there's an answer that doesn't require restarting Xcode I'll go for that, but for now this seems to be the answer :/

Yay for beta software!

ericsoco
  • 24,913
  • 29
  • 97
  • 127
2

You can bring back the console frame by following the steps below:

  1. Open the assistant editor. In the assistant editor, find the playground timeline screen.

  2. In the playground timeline screen, find the bottom right corner box, where it contains "- 31 +" (In my case it says the time elapsed is 31; it can differ according to your code).

  3. Click the "+" / "-" mark in the "- 31 +" box.

  4. There your result, console frame along with the other frames could have come there.

    time elapsed box

Community
  • 1
  • 1
Suresh Kumar Durairaj
  • 2,104
  • 16
  • 24
1

The keyboard shortcut is Cmd + Shift + Y

Maciek Czarnik
  • 5,950
  • 2
  • 37
  • 50
1

If you've opened the Assistant editor, either by using Cmd+Option+Enter, or selecting the white/plus icon on the left of a line, and then removed the "Console output" there are some alternatives which may help you in getting it back:

  1. Make sure you don't have any errors in your playground, as they stop execution and thusly any output to the Assistant Editor
  2. Make a change so that playground is re-executed
  3. Force a new run of the playground using Editor > Execute Playground
  4. Change the timer in the lower right, as this also triggers a new run of the playground
  5. Restart Xcode as the playground is a little buggy, and you sometimes just need to restart everything... :-(
holroy
  • 3,047
  • 25
  • 41
0

Put a /* at the top line of your code area to comment out everything. The Console Output box will reappear at the top of the right-hand panel (the Assistant editor panel).

Some errors may show in the Console box. Ignore.

Now delete the /* and the Console box will stay put.

0

have just started xcode (version 7.0.1) using swift but had the same problem, to show how the code will appear in console I toggled the little triangle next to the play button on the bottom left of the screen triangle toggle button this then open a view in which I could see the results of the code console opend hope this helps

stocksmat
  • 1
  • 2