Building and Deploying Qt Applications to the Playbook: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
=Building and Deploying Qt Applications to the Playbook=
[[Category:BlackBerry PlayBook OS]]
 
= Building and Deploying Qt Applications to the Playbook =


It is actually very easy to build and deploy Qt applications to the Playbook. The process is very similar to building any other Qt application. The only differences arise in packaging the application and the deployment steps which we will detail here.
It is actually very easy to build and deploy Qt applications to the Playbook. The process is very similar to building any other Qt application. The only differences arise in packaging the application and the deployment steps which we will detail here.


==About the Playbook Packaging System==
== About the Playbook Packaging System ==


To deploy an application to the Playbook we need to create a package called a bar file. A bar file is basically an archive file that contains the directory structure for your application and any additional resources that it needs. When developing an application we create a bar file using our debug token that we made earlier. This allows the bar file to be deployed only to the device that holds that debug token. The command line tools to package and deploy your application are included the <span class="caps">BBNDK</span> that we have already installed.
To deploy an application to the Playbook we need to create a package called a bar file. A bar file is basically an archive file that contains the directory structure for your application and any additional resources that it needs. When developing an application we create a bar file using our debug token that we made earlier. This allows the bar file to be deployed only to the device that holds that debug token. The command line tools to package and deploy your application are included the BBNDK that we have already installed.


The approach we will take is to modify the .pro file for your project to add an additional Makefile target that will create the bar file for you.
The approach we will take is to modify the .pro file for your project to add an additional Makefile target that will create the bar file for you.


==Preparing Your Project File==
== Preparing Your Project File ==


Before we begin building your application we need to edit the .pro qmake project file to include some directives to help us package up our applications ready for deployment. Here is an example .pro file for a very simple hello world Qt 5 application that uses QtQuick2:
Before we begin building your application we need to edit the .pro qmake project file to include some directives to help us package up our applications ready for deployment. Here is an example .pro file for a very simple hello world Qt 5 application that uses QtQuick2:


Now that looks scary at first sight but it’s actually pretty simple to see what is going on in there. At the top of the file we have the usual qmake variables that can be found in pretty much any Qt project. The interesting stuff for our purposes here is found within the qnx {} scope. Let’s break it down into easy steps.
<code><br />TEMPLATE = app<br />TARGET = helloqtquick2<br />DEPENDPATH ''= .<br />INCLUDEPATH''= .
 
QT ''= qml quick
<br />SOURCES''= main.cpp
 
RESOURCES ''= helloqtquick2.qrc
<br />OTHER_FILES''= main.qml
 
qnx {<br /> QMAKE_LFLAGS ''= '-Wl,-rpath,#39;./app/native/lib#39;'
<br /> PACKAGE_ARGS =  $${PWD}/bar-descriptor.xml $$TARGET  -e $${PWD}/icon.png res/icon.png  -e $$[QT_INSTALL_LIBS]/libQtCore.so.5 lib/libQtCore.so.5  -e $$[QT_INSTALL_LIBS]/libQtGui.so.5 lib/libQtGui.so.5  -e $$[QT_INSTALL_LIBS]/libQtOpenGL.so.5 lib/libQtOpenGL.so.5  -e $$[QT_INSTALL_LIBS]/libQtNetwork.so.5 lib/libQtNetwork.so.5  -e $$[QT_INSTALL_LIBS]/libQtWidgets.so.5 lib/libQtWidgets.so.5  -e $$[QT_INSTALL_LIBS]/libQtQuick.so.5 lib/libQtQuick.so.5  -e $$[QT_INSTALL_LIBS]/libQtQml.so.5 lib/libQtQml.so.5  -e $$[QT_INSTALL_LIBS]/libQtSql.so.5 lib/libQtSql.so.5  -e $$[QT_INSTALL_LIBS]/libQtV8.so.5 lib/libQtV8.so.5  -e $$[QT_INSTALL_LIBS]/libQtXmlPatterns.so.5 lib/libQtXmlPatterns.so.5  -e $$[QT_INSTALL_PLUGINS]/platforms/libqnx.so plugins/platforms/libqnx.so  -e $$[QT_INSTALL_IMPORTS]/ qml/
<br /> package.target = $${TARGET}.bar<br /> package.depends = $$TARGET<br /> package.commands = blackberry-nativepackager  -package $${TARGET}.bar  -devMode -debugToken $$(DEBUG_TOKEN)  $${PACKAGE_ARGS}
<br /> QMAKE_EXTRA_TARGETS''= package


First of all we have the line:
OTHER_FILES ''= bar-descriptor.xml<br />}<br /></code>
<br />Now that looks scary at first sight but it's actually pretty simple to see what is going on in there. At the top of the file we have the usual qmake variables that can be found in pretty much any Qt project. The interesting stuff for our purposes here is found within the qnx {} scope. Let's break it down into easy steps.
<br />First of all we have the line:
<br /><code><br />QMAKE_LFLAGS''= '-Wl,-rpath,#39;./app/native/lib#39;'<br /></code>


This tells the linker that when the application is executed on the device it should additionally look for libraries inside the directory ./app/native/lib relative to the application.
This tells the linker that when the application is executed on the device it should additionally look for libraries inside the directory ./app/native/lib relative to the application.


We then define a variable called <span class="caps">PACKAGE</span>_ARGS with:
We then define a variable called PACKAGE_ARGS with:
 
<code><br />PACKAGE_ARGS = $${PWD}/bar-descriptor.xml $$TARGET  -e $${PWD}/icon.png res/icon.png  -e $$[QT_INSTALL_LIBS]/libQtCore.so.5 lib/libQtCore.so.5  -e $$[QT_INSTALL_LIBS]/libQtGui.so.5 lib/libQtGui.so.5  -e $$[QT_INSTALL_LIBS]/libQtOpenGL.so.5 lib/libQtOpenGL.so.5  -e $$[QT_INSTALL_LIBS]/libQtNetwork.so.5 lib/libQtNetwork.so.5  -e $$[QT_INSTALL_LIBS]/libQtWidgets.so.5 lib/libQtWidgets.so.5  -e $$[QT_INSTALL_LIBS]/libQtQuick.so.5 lib/libQtQuick.so.5  -e $$[QT_INSTALL_LIBS]/libQtQml.so.5 lib/libQtQml.so.5  -e $$[QT_INSTALL_LIBS]/libQtSql.so.5 lib/libQtSql.so.5  -e $$[QT_INSTALL_LIBS]/libQtV8.so.5 lib/libQtV8.so.5  -e $$[QT_INSTALL_LIBS]/libQtXmlPatterns.so.5 lib/libQtXmlPatterns.so.5  -e $$[QT_INSTALL_PLUGINS]/platforms/libqnx.so plugins/platforms/libqnx.so  -e $$[QT_INSTALL_IMPORTS]/ qml/<br /></code>


This contains the arguments that will be passed to the command line tool that will actually create our application’s package (the .bar file). This variable contains a few interesting parts:
This contains the arguments that will be passed to the command line tool that will actually create our application's package (the .bar file). This variable contains a few interesting parts:


# The bar-descriptor.xml file is a simple <span class="caps">XML</span> file that describes our package and how it should be launched. Many of the other arguments listed here can optionally be specified inside the bar-descriptor.xml file instead.
# The bar-descriptor.xml file is a simple XML file that describes our package and how it should be launched. Many of the other arguments listed here can optionally be specified inside the bar-descriptor.xml file instead.
# Then what follows are a lot of -e &lt;source&gt; &lt;dest&gt; directives. These just tell the packaging tool to copy the &lt;source&gt; location to &lt;dest&gt; inside of the bar file and hence to &lt;dest&gt; within the application’s sandbox when deployed onto the device.
# Then what follows are a lot of -e &lt;source&amp;gt; &lt;dest&amp;gt; directives. These just tell the packaging tool to copy the &lt;source&amp;gt; location to &lt;dest&amp;gt; inside of the bar file and hence to &lt;dest&amp;gt; within the application's sandbox when deployed onto the device.  


<blockquote>
<blockquote>Note that the icon needs to be 86x86 pixels.
</blockquote>
For now we have to do this manually as Qt 5 is not part of the Playbook's firmware image yet and Qt Creator does not yet have an automatic way of determining what should go into your .bar file. This situation should improve shortly.


Note that the icon needs to be 86×86 pixels.
The last section of the .pro file creates the actual Makefile target for us:


</blockquote>
<code><br /> package.target = $${TARGET}.bar<br /> package.depends = $$TARGET<br /> package.commands = blackberry-nativepackager  -package $${TARGET}.bar  -devMode -debugToken $$(DEBUG_TOKEN)  $${PACKAGE_ARGS}


For now we have to do this manually as Qt 5 is not part of the Playbook’s firmware image yet and Qt Creator does not yet have an automatic way of determining what should go into your .bar file. This situation should improve shortly.
QMAKE_EXTRA_TARGETS += package<br /></code>


The last section of the .pro file creates the actual Makefile target for us:
where $$(DEBUG_TOKEN) is an environment variable that you need to set that points at the path to your debug token. For example on Linux you could do:


where $$(<span class="caps">DEBUG</span>_TOKEN) is an environment variable that you need to set that points at the path to your debug token. For example on Linux you could do:
<code><br />export DEBUG_TOKEN=&quot;$HOME/.rim/debugtoken.bar&amp;quot;<br /></code>


You should be able to pretty much copy and paste the above into your own .pro files to adapt it to additionally create a Playbook bar file package.
You should be able to pretty much copy and paste the above into your own .pro files to adapt it to additionally create a Playbook bar file package.
Line 42: Line 62:
To go along with the above .pro file we need a bar-descriptor.xml file. Here is a fairly typical example:
To go along with the above .pro file we need a bar-descriptor.xml file. Here is a fairly typical example:


The fields are fairly self-explanatory but more information can be found [https://developer.blackberry.com/native/documentation/core/com.qnx.doc.ide.userguide/topic/capabilities_editor_options_base.html here] ''[developer.blackberry.com]''
<code><br />&amp;lt;?xml version=&quot;1.0&amp;quot; encoding=&quot;utf-8&amp;quot; standalone=&quot;no&amp;quot;?&amp;gt;<br />&lt;qnx &gt;<br /> &lt;id&amp;gt;com.kdab.helloqtquick2&amp;lt;/id&amp;gt;<br /> &lt;filename&amp;gt;helloqtquick2&amp;lt;/filename&amp;gt;<br /> &lt;name&amp;gt;Hello QtQuick2&amp;lt;/name&amp;gt;<br /> &lt;versionNumber&amp;gt;1.0.0&amp;lt;/versionNumber&amp;gt;<br /> &lt;buildId&amp;gt;1&amp;lt;/buildId&amp;gt;<br /> &lt;description&amp;gt;Hello QtQuick2&amp;lt;/description&amp;gt;<br /> &lt;copyright&amp;gt;2012&amp;lt;/copyright&amp;gt;
 
&lt;initialWindow&amp;gt;<br /> &lt;systemChrome&amp;gt;none&amp;lt;/systemChrome&amp;gt;<br /> &lt;transparent&amp;gt;false&amp;lt;/transparent&amp;gt;<br /> &lt;autoOrients&amp;gt;true&amp;lt;/autoOrients&amp;gt;<br /> &lt;aspectRatio&amp;gt;landscape&amp;lt;/aspectRatio&amp;gt;<br /> &lt;/initialWindow&amp;gt;
 
&lt;publisher&amp;gt;KDAB&amp;lt;/publisher&amp;gt;<br /> &lt;permission system=&quot;true&amp;quot;&gt;run_native&amp;lt;/permission&amp;gt;<br /> &lt;env var=&quot;LD_LIBRARY_PATH&amp;quot; value=&quot;app/native/lib&amp;quot;/&amp;gt;<br /> &lt;env var=&quot;QT_PLUGIN_PATH&amp;quot; value=&quot;app/native/plugins&amp;quot;/&amp;gt;<br /> &lt;env var=&quot;QML_IMPORT_PATH&amp;quot; value=&quot;app/native/imports&amp;quot;/&amp;gt;<br /> &lt;env var=&quot;QML2_IMPORT_PATH&amp;quot; value=&quot;app/native/qml&amp;quot;/&amp;gt;<br /> &lt;category&amp;gt;core.games&amp;lt;/category&amp;gt;<br /> &lt;icon&amp;gt;&lt;image&amp;gt;res/icon.png&amp;lt;/image&amp;gt;&lt;/icon&amp;gt;<br /> &lt;/qnx&amp;gt;<br /></code>


==Building and packaging==
The fields are fairly self-explanatory but more information can be found &quot;here&amp;quot;:https://developer.blackberry.com/native/documentation/core/com.qnx.doc.ide.userguide/topic/capabilities_editor_options_base.html
 
== Building and packaging ==


To build and package our application is now simplicity itself. All we have to do is:
To build and package our application is now simplicity itself. All we have to do is:


where &lt;app-name&gt; is the name of your application. In this case it would be make helloqtquick2.bar. You should now have a .bar file in your build directory ready to be deployed.
<code><br />$ qmake<br />$ make -j&amp;lt;N&amp;gt;<br />$ make &lt;app-name&amp;gt;.bar<br /></code>


==Deploying and Running==
where &lt;app-name&amp;gt; is the name of your application. In this case it would be make helloqtquick2.bar. You should now have a .bar file in your build directory ready to be deployed.


To deploy your bar file to the Playbook we use another tool included in the <span class="caps">BBNDK</span> called blackberry-deploy. The syntax for this tool is:
== Deploying and Running ==


Once this tool has executed you should see your application icon in the launcher of the Playbook.<br /> The console output of the application is saved in the /accounts/1000/appdata/*APPNAME*/logs/log file on the device.
To deploy your bar file to the Playbook we use another tool included in the BBNDK called blackberry-deploy. The syntax for this tool is:


==Removing an application from the device or simulator==
<code><br />$ blackberry-deploy -installApp -device &lt;device-ip&amp;gt; -password &lt;device-password&amp;gt; &lt;appname&amp;gt;.bar<br /></code>
 
Once this tool has executed you should see your application icon in the launcher of the Playbook.<br />The console output of the application is saved in the /accounts/1000/appdata/*APPNAME*/logs/log file on the device.
 
== Removing an application from the device or simulator ==


Open a command prompt windows, and then type:
Open a command prompt windows, and then type:


==Deploying Qt to a central place==
<code><br />$ blackberry-deploy -uninstallApp -device &lt;device-ip&amp;gt; -package &lt;appname&amp;gt;.bar -password &lt;device-password&amp;gt;<br /></code>
 
The method described above copies Qt into the application’s <span class="caps">BAR</span> package, which increases its size considerably and makes deploying really slow. For development, it is useful to have Qt preinstalled on the device. See [[Deploying Qt to a central place on Blackberry devices|this article on how to install Qt to a central place]] ''[qt.io]''


Of course you also need to undo the changes to the ''.pro'' file above, so that Qt is not added to the <span class="caps">BAR</span> package automatically.<br /> Also, the above ''bar-descriptor.xml'' file already contains lines that set environment variables, these need to be overwritten with those lines mentioned in the article.
== Deploying Qt to a central place ==


==See also==
The method described above copies Qt into the application's BAR package, which increases its size considerably and makes deploying really slow. For development, it is useful to have Qt preinstalled on the device. See &quot;this article on how to install Qt to a central place&amp;quot;:http://wiki.qt.io/Deploying_Qt_to_a_central_place_on_Blackberry_devices


* [[BlackBerry]]
Of course you also need to undo the changes to the ''.pro'' file above, so that Qt is not added to the BAR package automatically.<br />Also, the above ''bar-descriptor.xml'' file already contains lines that set environment variables, these need to be overwritten with those lines mentioned in the article.
* [[Building-Qt5-for-the-Playbook|Building Qt5 for the Playbook]]
* [[Building-Qt4-for-Blackberry|Building Qt4 for Blackberry]]


===Categories:===
== See also ==


* [[:Category:BlackBerry-PlayBook-OS|BlackBerry PlayBook OS]]
* [[Blackberry]]
* [[Building-Qt5-for-the-Playbook]]

Revision as of 09:39, 24 February 2015


Building and Deploying Qt Applications to the Playbook

It is actually very easy to build and deploy Qt applications to the Playbook. The process is very similar to building any other Qt application. The only differences arise in packaging the application and the deployment steps which we will detail here.

About the Playbook Packaging System

To deploy an application to the Playbook we need to create a package called a bar file. A bar file is basically an archive file that contains the directory structure for your application and any additional resources that it needs. When developing an application we create a bar file using our debug token that we made earlier. This allows the bar file to be deployed only to the device that holds that debug token. The command line tools to package and deploy your application are included the BBNDK that we have already installed.

The approach we will take is to modify the .pro file for your project to add an additional Makefile target that will create the bar file for you.

Preparing Your Project File

Before we begin building your application we need to edit the .pro qmake project file to include some directives to help us package up our applications ready for deployment. Here is an example .pro file for a very simple hello world Qt 5 application that uses QtQuick2:

<br />TEMPLATE = app<br />TARGET = helloqtquick2<br />DEPENDPATH ''= .<br />INCLUDEPATH''= .

QT ''= qml quick
<br />SOURCES''= main.cpp

RESOURCES ''= helloqtquick2.qrc
<br />OTHER_FILES''= main.qml

qnx {<br /> QMAKE_LFLAGS ''= '-Wl,-rpath,#39;./app/native/lib#39;'
<br /> PACKAGE_ARGS =  $${PWD}/bar-descriptor.xml $$TARGET  -e $${PWD}/icon.png res/icon.png  -e $$[QT_INSTALL_LIBS]/libQtCore.so.5 lib/libQtCore.so.5  -e $$[QT_INSTALL_LIBS]/libQtGui.so.5 lib/libQtGui.so.5  -e $$[QT_INSTALL_LIBS]/libQtOpenGL.so.5 lib/libQtOpenGL.so.5  -e $$[QT_INSTALL_LIBS]/libQtNetwork.so.5 lib/libQtNetwork.so.5  -e $$[QT_INSTALL_LIBS]/libQtWidgets.so.5 lib/libQtWidgets.so.5  -e $$[QT_INSTALL_LIBS]/libQtQuick.so.5 lib/libQtQuick.so.5  -e $$[QT_INSTALL_LIBS]/libQtQml.so.5 lib/libQtQml.so.5  -e $$[QT_INSTALL_LIBS]/libQtSql.so.5 lib/libQtSql.so.5  -e $$[QT_INSTALL_LIBS]/libQtV8.so.5 lib/libQtV8.so.5  -e $$[QT_INSTALL_LIBS]/libQtXmlPatterns.so.5 lib/libQtXmlPatterns.so.5  -e $$[QT_INSTALL_PLUGINS]/platforms/libqnx.so plugins/platforms/libqnx.so  -e $$[QT_INSTALL_IMPORTS]/ qml/
<br /> package.target = $${TARGET}.bar<br /> package.depends = $$TARGET<br /> package.commands = blackberry-nativepackager  -package $${TARGET}.bar  -devMode -debugToken $$(DEBUG_TOKEN)  $${PACKAGE_ARGS}
<br /> QMAKE_EXTRA_TARGETS''= package

OTHER_FILES ''= bar-descriptor.xml<br />}<br />


Now that looks scary at first sight but it's actually pretty simple to see what is going on in there. At the top of the file we have the usual qmake variables that can be found in pretty much any Qt project. The interesting stuff for our purposes here is found within the qnx {} scope. Let's break it down into easy steps.
First of all we have the line:


<br />QMAKE_LFLAGS''= '-Wl,-rpath,#39;./app/native/lib#39;'<br />

This tells the linker that when the application is executed on the device it should additionally look for libraries inside the directory ./app/native/lib relative to the application.

We then define a variable called PACKAGE_ARGS with:

<br />PACKAGE_ARGS =  $${PWD}/bar-descriptor.xml $$TARGET  -e $${PWD}/icon.png res/icon.png  -e $$[QT_INSTALL_LIBS]/libQtCore.so.5 lib/libQtCore.so.5  -e $$[QT_INSTALL_LIBS]/libQtGui.so.5 lib/libQtGui.so.5  -e $$[QT_INSTALL_LIBS]/libQtOpenGL.so.5 lib/libQtOpenGL.so.5  -e $$[QT_INSTALL_LIBS]/libQtNetwork.so.5 lib/libQtNetwork.so.5  -e $$[QT_INSTALL_LIBS]/libQtWidgets.so.5 lib/libQtWidgets.so.5  -e $$[QT_INSTALL_LIBS]/libQtQuick.so.5 lib/libQtQuick.so.5  -e $$[QT_INSTALL_LIBS]/libQtQml.so.5 lib/libQtQml.so.5  -e $$[QT_INSTALL_LIBS]/libQtSql.so.5 lib/libQtSql.so.5  -e $$[QT_INSTALL_LIBS]/libQtV8.so.5 lib/libQtV8.so.5  -e $$[QT_INSTALL_LIBS]/libQtXmlPatterns.so.5 lib/libQtXmlPatterns.so.5  -e $$[QT_INSTALL_PLUGINS]/platforms/libqnx.so plugins/platforms/libqnx.so  -e $$[QT_INSTALL_IMPORTS]/ qml/<br />

This contains the arguments that will be passed to the command line tool that will actually create our application's package (the .bar file). This variable contains a few interesting parts:

  1. The bar-descriptor.xml file is a simple XML file that describes our package and how it should be launched. Many of the other arguments listed here can optionally be specified inside the bar-descriptor.xml file instead.
  2. Then what follows are a lot of -e <source&gt; <dest&gt; directives. These just tell the packaging tool to copy the <source&gt; location to <dest&gt; inside of the bar file and hence to <dest&gt; within the application's sandbox when deployed onto the device.

Note that the icon needs to be 86x86 pixels.

For now we have to do this manually as Qt 5 is not part of the Playbook's firmware image yet and Qt Creator does not yet have an automatic way of determining what should go into your .bar file. This situation should improve shortly.

The last section of the .pro file creates the actual Makefile target for us:

<br /> package.target = $${TARGET}.bar<br /> package.depends = $$TARGET<br /> package.commands = blackberry-nativepackager  -package $${TARGET}.bar  -devMode -debugToken $$(DEBUG_TOKEN)  $${PACKAGE_ARGS}

QMAKE_EXTRA_TARGETS += package<br />

where $$(DEBUG_TOKEN) is an environment variable that you need to set that points at the path to your debug token. For example on Linux you could do:

<br />export DEBUG_TOKEN=&quot;$HOME/.rim/debugtoken.bar&amp;quot;<br />

You should be able to pretty much copy and paste the above into your own .pro files to adapt it to additionally create a Playbook bar file package.

To go along with the above .pro file we need a bar-descriptor.xml file. Here is a fairly typical example:

<br />&amp;lt;?xml version=&quot;1.0&amp;quot; encoding=&quot;utf-8&amp;quot; standalone=&quot;no&amp;quot;?&amp;gt;<br />&lt;qnx &gt;<br /> &lt;id&amp;gt;com.kdab.helloqtquick2&amp;lt;/id&amp;gt;<br /> &lt;filename&amp;gt;helloqtquick2&amp;lt;/filename&amp;gt;<br /> &lt;name&amp;gt;Hello QtQuick2&amp;lt;/name&amp;gt;<br /> &lt;versionNumber&amp;gt;1.0.0&amp;lt;/versionNumber&amp;gt;<br /> &lt;buildId&amp;gt;1&amp;lt;/buildId&amp;gt;<br /> &lt;description&amp;gt;Hello QtQuick2&amp;lt;/description&amp;gt;<br /> &lt;copyright&amp;gt;2012&amp;lt;/copyright&amp;gt;

&lt;initialWindow&amp;gt;<br /> &lt;systemChrome&amp;gt;none&amp;lt;/systemChrome&amp;gt;<br /> &lt;transparent&amp;gt;false&amp;lt;/transparent&amp;gt;<br /> &lt;autoOrients&amp;gt;true&amp;lt;/autoOrients&amp;gt;<br /> &lt;aspectRatio&amp;gt;landscape&amp;lt;/aspectRatio&amp;gt;<br /> &lt;/initialWindow&amp;gt;

&lt;publisher&amp;gt;KDAB&amp;lt;/publisher&amp;gt;<br /> &lt;permission system=&quot;true&amp;quot;&gt;run_native&amp;lt;/permission&amp;gt;<br /> &lt;env var=&quot;LD_LIBRARY_PATH&amp;quot; value=&quot;app/native/lib&amp;quot;/&amp;gt;<br /> &lt;env var=&quot;QT_PLUGIN_PATH&amp;quot; value=&quot;app/native/plugins&amp;quot;/&amp;gt;<br /> &lt;env var=&quot;QML_IMPORT_PATH&amp;quot; value=&quot;app/native/imports&amp;quot;/&amp;gt;<br /> &lt;env var=&quot;QML2_IMPORT_PATH&amp;quot; value=&quot;app/native/qml&amp;quot;/&amp;gt;<br /> &lt;category&amp;gt;core.games&amp;lt;/category&amp;gt;<br /> &lt;icon&amp;gt;&lt;image&amp;gt;res/icon.png&amp;lt;/image&amp;gt;&lt;/icon&amp;gt;<br /> &lt;/qnx&amp;gt;<br />

The fields are fairly self-explanatory but more information can be found "here&quot;:https://developer.blackberry.com/native/documentation/core/com.qnx.doc.ide.userguide/topic/capabilities_editor_options_base.html

Building and packaging

To build and package our application is now simplicity itself. All we have to do is:

<br />$ qmake<br />$ make -j&amp;lt;N&amp;gt;<br />$ make &lt;app-name&amp;gt;.bar<br />

where <app-name&gt; is the name of your application. In this case it would be make helloqtquick2.bar. You should now have a .bar file in your build directory ready to be deployed.

Deploying and Running

To deploy your bar file to the Playbook we use another tool included in the BBNDK called blackberry-deploy. The syntax for this tool is:

<br />$ blackberry-deploy -installApp -device &lt;device-ip&amp;gt; -password &lt;device-password&amp;gt; &lt;appname&amp;gt;.bar<br />

Once this tool has executed you should see your application icon in the launcher of the Playbook.
The console output of the application is saved in the /accounts/1000/appdata/*APPNAME*/logs/log file on the device.

Removing an application from the device or simulator

Open a command prompt windows, and then type:

<br />$ blackberry-deploy -uninstallApp -device &lt;device-ip&amp;gt; -package &lt;appname&amp;gt;.bar -password &lt;device-password&amp;gt;<br />

Deploying Qt to a central place

The method described above copies Qt into the application's BAR package, which increases its size considerably and makes deploying really slow. For development, it is useful to have Qt preinstalled on the device. See "this article on how to install Qt to a central place&quot;:http://wiki.qt.io/Deploying_Qt_to_a_central_place_on_Blackberry_devices

Of course you also need to undo the changes to the .pro file above, so that Qt is not added to the BAR package automatically.
Also, the above bar-descriptor.xml file already contains lines that set environment variables, these need to be overwritten with those lines mentioned in the article.

See also