Packaging a native C/C++ app for installation

To create a .bar file for a native C/C++ app, you run the blackberry-nativepackager. The blackberry-nativepackager creates a .bar file that includes all of your app's resources as well as the following key components:
  • app descriptor file, which includes capabilities specified in <action> elements (bar-descriptor.xml). You should list the assets required by your app in the app descriptor file.
  • launch icon (icon.png)

To package your app:

  1. Open a command prompt.
  2. Navigate to the directory where your native project is stored.
  3. Run the following command:
    blackberry-nativepackager -package -devMode bar-package [app-desc files]
    where:
    • bar-package is the path to the location where you want the BAR file to be created
    • app-desc is the path to the application descriptor file (bar-descriptor.xml)
    • files is a sequence of paths to files or directories to include in the package.
    These paths can be absolute or relative to a current directory.

    You run the blackberry-nativepackager in developer mode because you don't need to sign your app. For information on other parameters, run the command:

    blackberry-nativepackager -help
The .bar file is created at the path you specified. You can now install and run the app on the target.