Question: How do you qdebug your own enterprise applications that run in work space in BlackBerry 10?

Source: Internet
Author: User
Tags ssh

You know, the enterprise application running in work space is pushed down through the BDS server, and the Cascade IDE is not even up to debug.

And there's no way you can see the log of the enterprise app below the/accounts/1000/appdata/myappxxxxxx/logs.


Idea: in CASCADE/QT main program, redirect Qdebug output to console and/tmp/ddemo_console.txt file, then I can use IDE ssh to connect to the phone above, view this text file to look at the log.


Step 1) Edit main program code, output text to console and/tmp/ddemo_console.txt file

void Mymessageoutput (Qtmsgtype type, const char* msg) {

	/* Print Debug message to IDE console *
	/std::fprintf (stdout, "%s\n", msg);
	Std::fflush (stdout);

	QString text;
	Switch (type)
	{case
	qtdebugmsg:
		text = QString ("Debug:%1"). Arg (msg);
		break;
	Case QTWARNINGMSG:
		text = QString ("Warning:%1"). Arg (msg);
		break;
	Case QTCRITICALMSG:
		text = QString ("Critical:%1"). Arg (msg);
		break;
	Case QTFATALMSG:
		text = QString ("Fatal:%1"). Arg (msg);
		break;
	}
	
	
	/* Print Debug message to File/tmp/ddemo_console.txt *
	/QFile file ("/tmp/ddemo_console.txt");
	File.Open (Qiodevice::writeonly | Qiodevice::append);
	Qtextstream ts (&file);
	ts<<text<<endl;
	File.close ();

	Std::fflush (stdout);

}


Step 2) redirect the Qdebug () output in the main () method of the program

Qinstallmsghandler (Mymessageoutput);


Step 3) In the application, output debugging information with Qdebug, such as

#include <QDebug>


Qdebug () << "Trying to start the demo.";

Step 4) Compile the signature application, upload it to the BDS server, and push the installation application onto the phone from the server.


Step 5) Enable developer mode on your phone, connect to your phone with IDE ssh on your PC and view the/tmp/ddemo_console.txt file.

Tail-f/tmp/ddemo_console.txt

----------------------------------------------

Reference: https://developer.blackberry.com/cascades/download/releasenotes/


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.