Package and launch an application from the command line
As an alternative to the QNX Momentics IDE, you can package and launch the sample application from the command line.
You can find the blackberry-nativepackager tool in the host usr/bin subfolder where you installed the native SDK. To make it easier to run the blackberry-nativepackager tool, add the path to the usr/bin subfolder where you installed the Native SDK to the PATH environment variable for your operating system. For more information about command line options, run blackberry-nativepackager from the command line with no options.
To build, package, and launch from the command line:
Download a sample app from http://developer.blackberry.com/native/sampleapps/bb10/ .
Extract the sample zip file to a location on your hard drive.
Change to the folder containing the sample, and type the following, where native-sample is the name of your sample application:
If you haven't already done so, type the following to set the environment variables used by the native SDK command line tools. The location of bbndk-env will be different if you've chosen an installation folder other than the default.
On Linux, if you installed the native SDK as a root user:
On Linux, if you installed the native SDK as a non-root user:
While still in the native-sampleMakefile directory, type make.You now have an application ready for packaging.
To package your native SDK application for a device, type this command (where native-sample is the name of your application, Configuration is the build configuration, and the \ indicates that the command needs to be typed on one line):
blackberry-nativepackager -package native-sample.bar \ bar-descriptor.xml -e Configuration/native-sample native-sample \ native-sample.pngYou can change the binary from Device-Release/native-sample or Device-Debug/native-sample (a BlackBerry device) to Simulator/native-sample to run the sample application on a simulator.