Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
singpolyma
Posts: 48
Registered: ‎11-15-2012
My Device: Q10
Accepted Solution

Getting console output on BB10 simulator

Is it possible to get access to the console (or at least the stderr) output of a Core NDK app deployed to th simulator?  I tried telnetting in to the simulator to run it, but the devuser does not have permissions on app folders.

 

Or perhaps there is a debug log like for Android?

 

If possible, I'd like to avoid using the IDE for this.

Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Getting console output on BB10 simulator

I'm not sure what "Core NDK" refers to, but any app that is packaged with the "-devMode" option would be installed under one of the 100 development userids, all of which the "devuser" can access when you SSH into the simulator or device.

For apps which are NOT built with -devMode, there is certainly no way you can see their output outside of the apps themselves, since that would be a big security problem.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Developer
singpolyma
Posts: 48
Registered: ‎11-15-2012
My Device: Q10

Re: Getting console output on BB10 simulator

From https://developer.blackberry.com/develop/platform_choice/ndk.html, "Core Native" means "not Cascades".

 

I packaged with -devMode and that let me get far enough to solve the initial problems, thanks :smileyhappy:  Though it seems that running the apps over telnet there is no way to exactly recreate the sort of env that running them from the launcher uses?  And also they don't actually show up on the screen.  Well, it's a start.

Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Getting console output on BB10 simulator

You don't actually run the app from the console, but you can use command line tools to look at the log output of the app.

Basically SSH in (it's not actually telnet) and change to the app's folder under /accounts/1000/appdata/... then run "tail -f logs/log" after launching the app, or just "cat logs/log". If the output you're interested in is no longer going to logs/log because of the new slogger2 stuff, you'd use some variant of "slog2info -w" instead.

You're quite correct that attempting to run the app from the console does not give it the same environment, and except in a very few special cases it serves no real purpose.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!