BlackBerry Hints n Tips: Difference between revisions
AutoSpider (talk | contribs) (Add "cleanup" tag) |
Henri Vikki (talk | contribs) No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | |||
[[Category:BlackBerry]] | [[Category:BlackBerry]] | ||
Most of the below works only if: | Most of the below works only if: | ||
Line 12: | Line 12: | ||
== Use SSH with your device == | == Use SSH with your device == | ||
First, use | First, use blackberry-connect to start the SSH demon on the device: | ||
<code> | <code> | ||
blackberry-connect <device-IP-address> -password <device-password> -sshPublicKey /path/to/some/public/key.pub | blackberry-connect <device-IP-address> -password <device-password> | ||
-sshPublicKey /path/to/some/public/key.pub | |||
</code> | </code> | ||
'''Note'''. | '''Note'''. blackberry-connect requires 4096 bit keys. Most probably, your default keys are shorter. Generate an another key pair under a different name, e.g.: | ||
<code> | <code> | ||
Line 23: | Line 24: | ||
</code> | </code> | ||
As long as the above | As long as the above blackberry-connect command runs in another terminal, you can access the device via SSH with same identity as in /path/to/some/public/key.pub: | ||
<code> | <code> | ||
ssh -i /path/to/private/key devuser@<device-IP-address> | ssh -i /path/to/private/key devuser@<device-IP-address> | ||
Line 32: | Line 33: | ||
== Watch the Qt debug outputs == | == Watch the Qt debug outputs == | ||
Qt debug outputs, like most other log outputs, are redirected to a special logging framework (called "slog2") instead of STDERR and STDOUT to improve performance. If you use Qt Creator, all Qt debug outputs are copied to the "Application Output" view. Sometimes, it is useful to watch Qt debug outputs in a terminal when the app is started directly from the device shell. First, you log-in via SSH. The | Qt debug outputs, like most other log outputs, are redirected to a special logging framework (called "slog2") instead of STDERR and STDOUT to improve performance. If you use Qt Creator, all Qt debug outputs are copied to the "Application Output" view. Sometimes, it is useful to watch Qt debug outputs in a terminal when the app is started directly from the device shell. First, you log-in via SSH. The slog2info command shows the messages posted into the slog2 framework. If you call it without arguments, it outputs just a current snapshot of messages. You can also start it in a "wait" mode (like tail) and limit its output to the messages from your app only: | ||
<code> | <code> | ||
Line 38: | Line 39: | ||
</code> | </code> | ||
The | The -b option limits the output to a selected buffer. The name of the buffer of your app is simply the same of the application home folder under /accounts/1000/appdata/. Qt debug outputs are posted under the ID 9000. grep 9000 is used to filter them from others. | ||
== Checking other log outputs and getting the core file if an app has crashed == | == Checking other log outputs and getting the core file if an app has crashed == | ||
When something happens on start-up (e.g. some dynamic libraries cannot be found) error messages go to the file: | When something happens on start-up (e.g. some dynamic libraries cannot be found) error messages go to the file: /accounts/1000/appdata/<app-home-folder-name>/logs/log. | ||
If your app crashes, its core file is copied into | If your app crashes, its core file is copied into /accounts/1000/appdata/<app-home-folder-name>/logs/ | ||
== Verify if the BAR application descriptor file and other meta information is correct == | == Verify if the BAR application descriptor file and other meta information is correct == | ||
Line 58: | Line 59: | ||
'''Situation''': The app pops-up very briefly on the screen and then closes | '''Situation''': The app pops-up very briefly on the screen and then closes | ||
''Possible reason'': Your app links to libs which cannot be found or something else is wrong with the app package. You should ssh to the device and check dynamic linker messages in | ''Possible reason'': Your app links to libs which cannot be found or something else is wrong with the app package. You should ssh to the device and check dynamic linker messages in /accounts/1000/appdata/<app-home-folder-name>/logs/log | ||
'''Situation''': The app appears on the screen, but the screen turns dark with a BlackBerry 10 logo in the background | '''Situation''': The app appears on the screen, but the screen turns dark with a BlackBerry 10 logo in the background |
Latest revision as of 09:31, 25 March 2015
Most of the below works only if:
- the development mode is enabled in the device. If it is not the case, an IP connection to the device cannot be established.
- You "sourced" the configuration script from the NDK in the current shell. If you have not done so, the tools will not be found.
Use SSH with your device
First, use blackberry-connect to start the SSH demon on the device:
blackberry-connect <device-IP-address> -password <device-password>
-sshPublicKey /path/to/some/public/key.pub
Note. blackberry-connect requires 4096 bit keys. Most probably, your default keys are shorter. Generate an another key pair under a different name, e.g.:
ssh-keygen -b 4096 -f ~/.ssh/id_rsa_4096
As long as the above blackberry-connect command runs in another terminal, you can access the device via SSH with same identity as in /path/to/some/public/key.pub:
ssh -i /path/to/private/key devuser@<device-IP-address>
Be aware, that Qt Creator uses the same procedure to connect to the device, but uses its own keys. If one connection to the device is already open in Qt Creator, you cannot open another one. Disconnect from the device in Qt Creator, first.
Watch the Qt debug outputs
Qt debug outputs, like most other log outputs, are redirected to a special logging framework (called "slog2") instead of STDERR and STDOUT to improve performance. If you use Qt Creator, all Qt debug outputs are copied to the "Application Output" view. Sometimes, it is useful to watch Qt debug outputs in a terminal when the app is started directly from the device shell. First, you log-in via SSH. The slog2info command shows the messages posted into the slog2 framework. If you call it without arguments, it outputs just a current snapshot of messages. You can also start it in a "wait" mode (like tail) and limit its output to the messages from your app only:
slog2info -w -b <app-home-folder-name> | grep 9000
The -b option limits the output to a selected buffer. The name of the buffer of your app is simply the same of the application home folder under /accounts/1000/appdata/. Qt debug outputs are posted under the ID 9000. grep 9000 is used to filter them from others.
Checking other log outputs and getting the core file if an app has crashed
When something happens on start-up (e.g. some dynamic libraries cannot be found) error messages go to the file: /accounts/1000/appdata/<app-home-folder-name>/logs/log.
If your app crashes, its core file is copied into /accounts/1000/appdata/<app-home-folder-name>/logs/
Verify if the BAR application descriptor file and other meta information is correct
- SSH to the device
- Go to the home folder of your app
- Check the app manifest:
> less app/META-INF/MANIFEST.MF
Cases when your app does not start properly
Situation: The app pops-up very briefly on the screen and then closes Possible reason: Your app links to libs which cannot be found or something else is wrong with the app package. You should ssh to the device and check dynamic linker messages in /accounts/1000/appdata/<app-home-folder-name>/logs/log
Situation: The app appears on the screen, but the screen turns dark with a BlackBerry 10 logo in the background Possible reason: One of the Qt plugins failed to load for some reasons. Set QT_DEBUG_PLUGINS=1 in the BAR application descriptor and watch the log in slog2. See Qt docs for more about debugging plugins.
Situation: The app appears on the screen, the screen turns white, but the app UI does not show up Possible reason: One of QML files did not load at start-up. Check the log in slog2.