How to show print output on Xcode console

Hello,
I am trying to test my apps on the Xcode simulator and on the real device, but I am facing the annoying problem of not being able to show print output on the Console for debugging purposes.

Following some posts on this forum, I put this line at the top of my main.lua file:

[lua]-- Output to console
io.output():setvbuf(“no”)[/lua]

but, when I launch the app on the Xcode simulator, or even when I install it on a device and let it connect to Xcode, I cannot see a single print statement output on the Console. So I tried to look at the configurations on Xcode, launching the same old terminal command:

[text]
xcode-select -print-path
[/text]

Since I have two different versions of Xcode on my development MBP, I tried changing this path to /Developer for Xcode 4.2 and to Applications/Xcode.app/Contents/Developer for Xcode 4.3. After each change I restart Corona, do a new build and test the app, but nothing changes. I am using both Corona 704 and 767 (the very last available build), with no success.

Am I doing something wrong here?

Thank you! [import]uid: 121401 topic_id: 23392 reply_id: 323392[/import]

If you see a blank console in Xcode, try switching the selection to your device and then back to the console tab on the left.

It seems buggy, and I’m not really sure why this happens. But usually when I switch the selection and back again it starts showing up again. [import]uid: 87138 topic_id: 23392 reply_id: 93712[/import]

I will try this asap. But, when I am using the Xcode simulator, where should I expect to see the print outputs? In which Console? [import]uid: 121401 topic_id: 23392 reply_id: 93713[/import]

Oh, sorry, that’s for on-device.

For the simulator, I believe you open Console.app (should be in your utilities folder), then filter based on your app’s name.

For the device console, press Cmd-Shft-2 from Xcode and view the console sub tab under your device. [import]uid: 87138 topic_id: 23392 reply_id: 93718[/import]

I am not able to do that. I mean, when I open the Console.app application I only get error messages from the Corona app, if any. I can see none of the print statements. That’s the same behavior as in the real device. [import]uid: 121401 topic_id: 23392 reply_id: 93726[/import]

I believe:

io.output():setvbuf("no")  

is meant to suppress the output. Take this out.

Note: When using Organizer to view Corona output, the output lags, and sometimes does not print at all. [import]uid: 21331 topic_id: 23392 reply_id: 93754[/import]

Just FYI, but that statement above actually does “turn on” print output in some cases. Specifically, I’ve been trying out SublimeText2 and this was needed to get print() statements to appear. [import]uid: 41884 topic_id: 23392 reply_id: 95758[/import]

Doh! That looks to be correct. Sorry about that peeps! Thanks for the kick richard9! [import]uid: 21331 topic_id: 23392 reply_id: 95773[/import]