Qt command-line options for blackberry-nativepackager

The blackberry-nativepackager command line must name the BAR file, app descriptor file, and Qt binary. The packaging tool allows you to list other files to include in the package and supports many command-line options for Qt apps.


blackberry-nativepackager [<commands>] [<options>] bar-package app-descriptor binary-file [resource-file]* 


Package the assets into an unsigned BAR file (this is the default behavior).
List all the files in the resulting package. This is useful for debugging packaging issues.
Print the BAR manifest. This is useful for debugging.

Packaging options:

-buildId ID
Set the build ID (which is the fourth segment of the version). Must be a number from 0 to 65535.
-buildIdFile file
Set the build ID from an existing file and save a new, incremented version to the same file.
Package the BAR file in development mode. This is required to run unsigned applications and to access application data remotely.

Path options:

-C dir
Use dir as a root directory. All files listed after this option will be used with tail paths in the output package.
-e file path
Save a file to the specified path in the package.

Other options:

Print the packaging tool version.
Print the advanced options.
Print the usage information. This will include other command-line options and commands that aren't listed here but don't apply to Qt apps.


Path of the output BAR package file.
Path of the app descriptor file.
Path of the Qt binary file.
Path of a resource file used by the Qt app. This could be an icon, a font definition file, an image, and so on. You can name as many resource files as you want.
Note: These paths can be absolute or relative to the current directory. The resulting location in the package is a tail path of the file, unless overridden by the -C or -e options.


The command line shown below packages the Settings app from the Qt5 HMI. The app binary, icon file, and several images from installed UI themes are included in the BAR file (QtSettingsApp.bar), which is generated based on the app descriptor file (settings-descriptor.xml):

blackberry-nativepackager.bat -package QtSettingsApp.bar -devMode settings-descriptor.xml
    -e %1\bin\settingsapp bin/settingsapp settings_icon.png
    -C %1\ %1\lib\ %1\share\qnxcar2\palettes\

In the actual command line, %1 is replaced with the path of the source directory containing the compiled Qt code. The -e and -C options take arguments, so the command-line tokens following these options refer to the files affected by them. Here, the -e option tells the packaging tool to store the app binary (which is located at %1\bin\settingsapp on the host system) at bin/settingsapp in the output package. The -C option removes the %1 folder from the paths of the subsequently named files. For example, the files in %1\lib on the host system get placed in /lib in the package.