Playground is not showing result on right bar
Asked Answered
B

20

27

I waited long time but my playground project is not showing result on right side bar I am using right code but still right bar is not updating i don't know what is the problem i tried lot of time. here is my code

var str = "Hello, playground"

var str1 = "this is my first program"

let kermit = "kermit"
let msPiggy = "ms. piggy"

let string1 =  msPiggy + " and " + kermit + ", sitting in a tree"
let string2 = "\(msPiggy) and \(kermit), sittting in a tree "

let string3 = " kermit has \(5*2) fingers"

let  chr1:Character = "💿"
Balalaika answered 6/10, 2014 at 6:34 Comment(1)
See here if you have an M1 Mac – Suhail
T
13

As of Xcode 8, unless you are print-ing out things, results in the playground could take a little bit more work to show.

In this screenshot, I show two things you can click on. #1 is the the "Show Debug Area" button, the middle button in the top right of the toolbar (i.e. which toggles the lower pane that slides up and down in the Xcode window). Results from print end up there.

the guys script

Also, the second set of (multiple) circles shows that you can click on to show results. You can slide the gray bar space wider to make things show.

Lastly, where you see the "Play" triangle in the lower toolbar, try clicking on that to force the Playground to execute your code again.

Trichotomy answered 6/10, 2014 at 6:39 Comment(3)
The only options for me in the Assistant Editor (in Xcode 8.2) are Manual file selection, and Timeline. – Duiker
Yeah, the Assistant Editor isn't nearly as useful (as of Xcode 8 and maybe even 7) as it used to be, so I've updated my answer to try to help anyone else get to the results they are looking for. – Trichotomy
In my case, very easy, Just drag right bar bigger, then the answer will appear. Hope it will help somebody. – Wendiewendin
V
10

In my case, I had to close Xcode 9.2 and close all simulators, then restart playground file, then it worked.

Valeta answered 24/1, 2018 at 0:42 Comment(0)
A
9

I am also facing this problem as shown in below image There is no log on the right bar

enter image description here

So what we do : We just Quit Xcode and again open playground project and it works fine

also, there is one more button through which you can set automatically and manually run

Ailey answered 8/1, 2019 at 15:12 Comment(0)
R
7

If you have M1 chip MacBook Pro, you have to uncheck Rosetta to get the Playground working.

Rightist answered 31/8, 2021 at 17:6 Comment(1)
This worked for me. You can uncheck Rosetta by going to Applications>Xcode, then right clicking and selecting Get Info. – Bouncer
P
4

My result area was somehow too narrow to show the results. Try dragging it larger.

Properly answered 18/10, 2016 at 17:30 Comment(0)
T
4

It's not the assistant editor that should be enabled. It's the little grey bar to the right that is too narrow. If you hover your mouse pointer just next to an expected result, you will see the familiar little eye and radio button icon. Then drag the bar out and it'll show. Hope it works!

Twelve answered 25/10, 2016 at 20:2 Comment(0)
R
4

add import PlaygroundSupport to the top of your code! i had the same issue and it worked perfectly.

Reiser answered 29/7, 2018 at 4:10 Comment(0)
D
4

I had the same issue, and discovered that if I held down the Play icon above the debug area (revealed at the bottom of the playground), it had an option, 'Automatically Run'.

I selected that, and all is well!

Cheers.

Darwinism answered 27/11, 2018 at 23:40 Comment(1)
This worked for me. Problem started after I had Xcode open and an overnight update ocurred. The phrase "hold down" is important in this advice; only by click and hold-the-click-down does the menu pop-up. First have to open the debug area; that is the icon at bottom of editor window that shows a square that is partitioned to have top and bottom parts; suggesting editor area and debug area. Compile time errors must be cleared-up for "Automatic" to display values. – Herpetology
E
3

In Xcode 10.1 I changed build system to Legacy Build System from file > Playground Setting. It fixed my problem

Euphoria answered 13/5, 2019 at 6:19 Comment(0)
D
2

In my case I have two Xcode versions installed on my mac. (v8.2.1 and v7.3.1)

The two Xcode is running simultaneously, and then when I decided to open a playground on v8.2.1 and printed out some codes. Playground should run it automatically but it is stuck in Running my file.

What I did is I restarted both of my Xcode applications and then Playground succesfully printed my codes.

https://forums.developer.apple.com/thread/3672

Deserved answered 3/2, 2017 at 9:24 Comment(0)
R
2

In my case i ensured i set the right Command Line Tool version by tapping Xcode>Preferences>Locations and it worked.

enter image description here

Rheims answered 11/3, 2021 at 17:1 Comment(0)
C
1

playground will not show results if any of your previous lines has error, you will have to remove those errors and all the results would immediately start showing up on right side bar.

Caucasian answered 7/10, 2015 at 10:51 Comment(0)
S
1

In my case for Xcode 9.2, output started appearing when I clicked File/New/Tab. So, Playground seems missing some refresh option and new tab did that.

Spiers answered 24/3, 2018 at 7:25 Comment(0)
N
1

oftentimes, I need to close my playground and Xcode and relaunch it again to see the results.

Norite answered 28/11, 2018 at 0:7 Comment(0)
T
1

Also had this problem. "Editor › Run Playground" worked for me.

Truffle answered 9/1, 2019 at 18:49 Comment(0)
A
0

i made a checklist to resolve this issue

  1. First of all make sure your 'result area' is not hidden, There should be some grey (result area) on right side, if whole screen is white then try to pull it from right-edge of screen.
  2. Make sure there is no code error, you can check code error in 'debug area'.
  3. If both point are resolve though you can not see result then try to print('hello world') at last.
Allness answered 18/9, 2017 at 7:26 Comment(0)
D
0

In my case, I was saving my playground somewhere else than the default path and it didn't show the result. Saving it on the default path made it work.

Dric answered 10/2, 2019 at 18:25 Comment(0)
H
0

In my case, ios: macOS Catalina Version 10.15.7 Xcode Version 12.1 (12A7403)

1.First Go to Editor then click run playgoundenter image description here 2.Then it will show the running results on the right side. enter image description here

Hectic answered 7/1, 2021 at 22:15 Comment(0)
S
0

With Xcode 12+, please uncheck Open using Rosetta.

enter image description here

Soukup answered 28/12, 2021 at 12:55 Comment(0)
H
0
  1. I saved my playground to the folder of my choosing, all the solutions to save it in default location are simply silly...
  2. I did have enabled the right-hand side area and console-output on the bottom.
  3. Whether running from Edit->Run Playground or using Cmd+Return didn't help, still no output was shown. Even though my code was solid and I could see Build Succeed in the top notificaiton area...
  4. After checking Preferences->Locations I could see there are no Command Line Tools seleceted, so I choosed only one available option (Xcode 13.2.1) and... still no output...
  5. Then I closed XCode with Cmd+Q and started it again...
  6. Finally it worked and output was shown...
Healy answered 26/2, 2022 at 11:3 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.