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
Regular Contributor
bemipefe
Posts: 73
Registered: ‎06-14-2013
My Carrier: PosteMobile
Accepted Solution

Debug an app installed from a signed .bar

I need to sign my app with RSA keys in order to work. So I generate the signed .bar exporting the project with Device-Debug configuration and then I install it on the device.

The question is: How can I debug my app ?

 

Obviously I can't just run the app in debug mode because in this way the app doesn't run as signed bar.

 

Is there a way to attach the app installed with the bar to a debugger ?

 

Thanks in advance.

Please use plain text.
Regular Contributor
bemipefe
Posts: 73
Registered: ‎06-14-2013
My Carrier: PosteMobile

Re: Debug an app installed from a signed .bar

[ Edited ]

Another way to debug an app is to use a Postmortem Debugging configuration which need a .core file generated when the app has crashed.

I know that when an app crash there must be a .core file in the logs folder of the app Sandbox.

In my case there is no .core file in this folder.

 

The question now is why ?

 

 

Please use plain text.
Administrator
MSohm
Posts: 14,065
Registered: ‎07-09-2008
My Carrier: Bell

Re: Debug an app installed from a signed .bar

When the app is built in release mode debugging is disabled. Core files would be generated, but they are generated in the app's release mode sandbox (not the one you can see using the Target File System Navigator). The only way to gain access them is through your app itself (the next time the app launches, it has access to its log directory in its sandbox). 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Regular Contributor
bemipefe
Posts: 73
Registered: ‎06-14-2013
My Carrier: PosteMobile

Re: Debug an app installed from a signed .bar

How can I get the path of the folder where the .core file is placed ?

For non-signed app is /accounts/1000/appdata but I can't figure out what is the path for signed one.

Please use plain text.
Administrator
MSohm
Posts: 14,065
Registered: ‎07-09-2008
My Carrier: Bell

Re: Debug an app installed from a signed .bar

You won't be able to browse to it directly.  The application will need to upload it somewhere or copy it to a public area like the shared folders.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Regular Contributor
bemipefe
Posts: 73
Registered: ‎06-14-2013
My Carrier: PosteMobile

Re: Debug an app installed from a signed .bar

Ok but to upload or copy this file I need the absolute path of the .core file and I don't know where the file is actually memorized when the app is in not in Development-Mode that is a signed app.

 

Please use plain text.
Administrator
MSohm
Posts: 14,065
Registered: ‎07-09-2008
My Carrier: Bell

Re: Debug an app installed from a signed .bar

Ahh ok, I understand what you mean now.  This line will return the directory the application is installed and running from.

 

QString path = QDir::current().absoluteFilePath();

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Regular Contributor
bemipefe
Posts: 73
Registered: ‎06-14-2013
My Carrier: PosteMobile

Re: Debug an app installed from a signed .bar

Ok thank you.

 

I guess this is the absolute path of the file MyApp.core :

 

QString path = QDir::current().absoluteFilePath("MyApp.core")

 

am I right ?

 

Please use plain text.
Administrator
MSohm
Posts: 14,065
Registered: ‎07-09-2008
My Carrier: Bell

Re: Debug an app installed from a signed .bar

The .core files are in the logs directory within your applications home directory.  So add a "logs" to the current path you get back.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.