Where can you see output to console?

766 views
Skip to first unread message

chris Moeller

unread,
Feb 18, 2015, 6:24:04 AM2/18/15
to rob...@googlegroups.com
Where can you see console output, that would normally be in eclipse in the console?
If I change it to the roboVM console in the eclipse console, it just shows the debug text for compiling, but not sure where I would find my output when I use things like:
Gdx.app.log("Game", "the game started!");
System.out.println("Testing printing a string out");
?
In the console it just ends with: 2/18/15 3:15:10 AM: [ INFO] Launch done

From the thread in December here:
http://stackoverflow.com/questions/27313591/ios-app-on-emulator-with-robovm-how-can-i-display-the-log-in-console
They have the same problem, but the answer was: "This is caused by a bug in RoboVM 1.0.0 alpha 04 when launching apps in an iOS 8.1 simulator."

But is it still an issue in: roboVMVersion = '1.0.0-beta-04', or is there some other place to find console output?

Even if I change to 7.1 (my only other option), if I debug, I still don't see the logged out output in the console, so maybe it is being output into a different place?

Matthew Robinson

unread,
Feb 19, 2015, 1:32:31 AM2/19/15
to rob...@googlegroups.com
With libGDX, I believe output from Gdx.app.log() should go to the foundation log, and therefore would be viewable in Xcode for a device and in the simulator logs for the simulator.

In order to capture stdout or stderr (e.g. System.out.println), you either have to have Eclipse running and look in the console, or redirect these streams to the foundation log. I found an example of this on github. Note that I modified the FoundationLogPrintStream code to somewhat hackily avoid the issue of trying to print the '%' character where you get tripped up by Foundation.log() doing printf() style % expansion:

        /* Since we might get strings that contain percent signs in the PrintStream and
         * NSLog will do printf() style expansion, we need to make sure to replace any
         * single percent character with a double percent before calling NSLog.
         */

       
String expandedText = text.replace("%", "%%");
       
Foundation.log(expandedText);

HTH.

chris Moeller

unread,
Feb 19, 2015, 3:56:05 AM2/19/15
to rob...@googlegroups.com
Ah, so you see the 'System.out.println' showing in the console in Eclipse, when running the simulator (when debugging from eclipse)?

Mine doesn't show anything past 'Launch done', when right clicking on the ios project and going to debug on ios iPad 8.1 simulator.
Maybe my eclipse is messed up or something :/

chris Moeller

unread,
Feb 21, 2015, 7:35:49 PM2/21/15
to rob...@googlegroups.com
Which eclipse version are you using where you can see the console output in eclipse (when debugging the iOS simulator)?

It's pretty much impossible to debug where it crashes if I can't even see console output :/

RoboVM must be working for some people if there are supposedly LibGDX games published to iOS, but I'm not sure if they were lucky to get it to work, or I'm just unlucky and having problems no one else has had (while following the docs they must have as well)

Matthew Robinson

unread,
Feb 21, 2015, 8:35:38 PM2/21/15
to rob...@googlegroups.com
I have eclipse Indigo on Mac OSX 10.9.5 with robovm beta-04, and running the iOS simulator 8.1 with iPhone 4s, and it's working fine for me.

Niklas Therning

unread,
Feb 22, 2015, 5:41:05 AM2/22/15
to Matthew Robinson, rob...@googlegroups.com
Chris, could be that you just need to switch to the right console. Have a look at the screenshot below.


Inline image 1

--
You received this message because you are subscribed to the Google Groups "RoboVM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robovm+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

chris Moeller

unread,
Mar 6, 2015, 1:07:43 AM3/6/15
to rob...@googlegroups.com, mpr9...@gmail.com
Thanks Niklas!

It randomly started showing the console output (and I wasn't sure whether it would have been the roboVM console or the project running console), but it did end up showing in the actual project console.

But have you had it randomly stop showing console output? It's been working fine the last few days, and then suddenly stopped showing anything (debug-> runs demo on simulator, but project console stays blank with no output). Restarted Eclipse and the simulator, but didn't change it. Restarted computer, and now it's outputting to the console again.



But I've been just working on trying to work by adding tiny parts at a time- adding a sub folder, testing, adding an asset, testing, but things will randomly work or not. Most of the time I can't tell if it's because I added something, or it's just not working on its own XD

It's been randomly getting to 85% on the eclipse progress bar, it does launch on the simulator, than showing a timeout error in eclipse. Not sure if there is any way to make the process smoother

Mario Zechner

unread,
Mar 6, 2015, 3:48:04 AM3/6/15
to rob...@googlegroups.com, mpr9...@gmail.com
The "RoboVM Console" sometimes seems to not get into the foreground during a build. I've seen this happen myself, we'll look into it. However, what you refer to as "stop showing console output" may actually just be a scrolling issue. Make sure your horizontally scroll to the left most border in the "RoboVM Console". I sometimes accidentially scroll away to the right, which makes it appear as if no output is printed to the console.
Reply all
Reply to author
Forward
0 new messages