Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No console output from Xcode 11 / iOS 13

My console is providing no output, no prints or system debug info on the right side and no variables on the left. I have both console windows open and I do have "All Output" selected. I have tried restarting Xcode and the machine itself but it doesn't seem to fix the issue. For the sake of debugging I am using Swift, I am unsure if this is related but it happened after enabling multiple windows but this may be a coincidence.

The issue is specific to each simulator as the only fix I have found is creating a new simulator but even this breaks after the first build and run.

Looking around I have seen this issue occur for others on Xcode 8 and adding the OS_ACTIVITY_MODE argument to the run scheme fixes it for those, I have tried and this does not work in this case. I suspect that this is Xcode 11 / iOS 13 specific as did not happen once on prior versions in my experience.

Are there any longterm fixes for this?

like image 606
pal1984 Avatar asked Sep 23 '19 11:09

pal1984


People also ask

Where is the console in Xcode 13?

Here is small tip for Xcode developers. To show/hide the Console click the icon Show/Hide the console in the lower right corner. It's the last icon on the lower right side of the panel.

Where is console output in Xcode?

Go to Xcode → Preferences → Debugging → On Start → "Show Console". Save this answer.

How do I see console in Swift?

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.


1 Answers

For XCode 11 users, not getting any output in their console, assuming that you have the console active (view > debug area > activate console), you'll have to right-click the live preview and select debug preview, as follows:

enter image description here

After that, you'll start getting output in your console!

enter image description here

The output above is the following source code, that you can create as a view let's say TestView.swift and copy/paste:

import SwiftUI

struct TestView: View {
    var body: some View {
        Button(action: { print("Hello world!") }) {
            Text("Click me!")
        }
    }
}

struct TestView_Previews: PreviewProvider {
    static var previews: some View {
        TestView()
    }
}
like image 57
punkbit Avatar answered Oct 26 '22 17:10

punkbit