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
Posts: 587
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

qDebug() Not Working on Device

I've used qDebug() thousands of times over the last couple of years, and all of the sudden it doesn't seem to be working anymore when deployed to the device.  It works fine on simulator.  I'm using the "Run" configuration.

 

I've tried deleting my run configuration and creating a new one, to no avail.

Developer
Posts: 587
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

Re: qDebug() Not Working on Device

I've tracked the issue down to:

 

    #ifndef QT_NO_DEBUG
    qInstallMsgHandler(myMessageOutput);
    #endif

 

Apparently when I run on device, QT_NO_DEBUG is defined, meaning that my qDebug() output goes nowhere.

 

I'm confused, because I could swear that "Run" mode in the past has shown console output.

 

Did something change?  Is something goofed up with my local IDE configuration?

 

Capture.PNG

Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: qDebug() Not Working on Device

[ Edited ]

From my experience Run usually displays debug info unless you ran the project in release mode then it simulates a live application

 

 

 

Right click project select run as

 

Then select build/run configurations

 

then you will see a drop down for the build configuration. It may be on active or device-release,

 

set it to device-debug and you should get your debug output again

 

 

Hope this helps

 

 

 

Off topic:

... Are they making you change the names of your sync for * apps?  I read on Crackberry the other day that they sent out notices to develpers that they had to change all of those names or they would be removed from the store.

Developer
Posts: 587
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

Re: qDebug() Not Working on Device

Aha!  I think you're on to something -- I think I changed that configuration from "Device-Debug" to "Debug-Release" a couple of days ago since when I'd try running my app on device, it would say something like "Program file not found", and I figured that "Device-Debug" was what should be used when "Debug" was selected from the IDE, while I was selecting "Run".

 

I'll give your suggestion a try...

 

As for my apps, I haven't received any email requesting me to change app names.  I did read something about people with apps named "App for ...", but mine are a bit different than that.

Developer
Posts: 828
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Rogers

Re: qDebug() Not Working on Device

Awesome!  Glad it's working for you and that they're not picking on your app names =)

 

 

 

The device-release option is actually very useful for testing out bugs before you release the app.  The lack of debug output is annoing(can be worked around to allow it) but oftentimes I have noticed errors in release mode that debug mode simply allows to slip by.