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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Android™ Runtime Development

Reply
Contributor
abenoit
Posts: 15
Registered: ‎01-16-2013
My Carrier: Free
Accepted Solution

Getting logs from smartphone

Hi everyone,

 

I couldn't find this information on the page "Testing your repackaged app on a BlackBerry device" so I hope someone here can help :

 

I have an application that was deployed on a phone (using blackberry-deploy.bat from a signed bar file) and sometimes some features don't work, but if I debug the application from eclipse on the same phone, it seems to work every time.

 

So I need to retrieve the logs from the application on the smartphone when the features don't work so I can figure out what is wrong. But I can't find how to read the application logs from the smartphone when it was not running in debug mode from eclipse.

 

So here is my question : How can I read an application's log from a smartphone when it's not connected to a debug launch in eclipse ? (something similar to adb logcat for standard android development ?)

 

Thanks,

 

Antoine

Please use plain text.
Contributor
abenoit
Posts: 15
Registered: ‎01-16-2013
My Carrier: Free

Re: Getting logs from smartphone

One more thing : when adb detects my BB10 device, I can see my apps' logs with logcat.

 

However, I cannot get adb to detect my BB10 device unless I deploy an application from eclipse.

 

But since I'm testing an application that I deployed from a bar file and not from eclipse, I would like to be able to use adb logcat (or some equivalent tool) without having to use a debug launch on eclipse.

Please use plain text.
Contributor
abenoit
Posts: 15
Registered: ‎01-16-2013
My Carrier: Free

Re: Getting logs from smartphone

Hi everyone,

 

Found the solution on an external blog. Thanks to its author for sharing this. In case someone else needs it, his post is here : http://www.ivity.asia/2012/02/08/deploying-testing-android-apps-on-the-blackberry-playbook/

 

To sum it up, it is actually quite simple. Here are the steps : (I'm doing it on windows, so I use the .bat version of scripts)

 

- First, you need to use blackberry-connect.bat, and to do that, you need to create an RSA key. If you don't have one yet, create it : It's the same used for SSH connection on the device. Here is some explanations on this :

http://blog.skufel.net/2012/07/how-to-access-blackberry-playbook-via-ssh/

 

- Once you have your key, use blackberry-connect.bat to connect to the device :

blackberry-connect.bat %DEVICE_IP% -password %DEVICE_PWD% -sshPublicKey %PUB_KEY_FILE%

 

- Once that connection is set up (keep it open), you need to connect with adb :

adb connect %DEVICE_IP%

This command prints something like : connected to 169.254.0.1:5555

This tells you where to connect your logcat

 

- Start logcat :

adb -s 169.254.0.1:5555 logcat -v time

(replace 169.254.0.1:5555 with what adb connect printed)

 

There you go !

 

Antoine

 

Please use plain text.