Packaging the BAR file from the command line

You can run the blackberry-nativepackager tool from the command line.

Before running the packaging command, ensure that you have:

The command-line process for packaging a Qt app is similar to the process of "Packaging a native C/C++ app for installation" described in the Application and Window Management guide. The key differences are the QNX CAR environment variables you can define in the app descriptor file for a Qt app.

To package a Qt app into a BAR file from the command line:
In a QNX Neutrino terminal, navigate to the location where your Qt app is stored, then enter the command line to package the app, in this format:

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

You must list the BAR file first, followed by the app descriptor file, and then the app files (which must include the binary) to store in the package. Otherwise, the command-line argument order is flexible; you can list the app files in any order and place commands and options at any location in the command line.

The exact name and location of the packaging tool and its command syntax is platform-dependent. On Linux, the tool is called blackberry-nativepackager and is stored in DEFAULT_SDP_PATH/host/linux/x86/usr/bin/. Any filepaths in the command line must use POSIX notation, using a forward slash (/) to indicate directories. On Windows, it's called blackberry-nativepackager.bat and is stored in DEFAULT_SDP_PATH\host\win32\x86\usr\bin. The command-line filepaths must follow the Windows convention, using a backslash (\) to indicate folders.

Consider the following packaging command line for a Windows host:

blackberry-nativepackager.bat -package -devMode birds_bar-descriptor.xml bin/angrybirds a_birds1.png

This command generates a BAR file named based on the birds_bar-descriptor.xml file. The BAR file contains the app's binary file (whose path is bin/angrybirds) and its icon file (a_birds1.png). For details on the -package and -devMode options and all other command options applicable to packaging Qt apps, see "Qt command-line options for blackberry-nativepackager".

After your app is packaged, you can deploy it on the target, as explained in "Deploying the BAR file on the target".