Package and launch an application from the command line
As an alternative to the 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 application from http://developer.blackberry.com/playbook/native/sampleapps and unzip the downloaded archive to a folder on your host computer.
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, Playbook 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 Playbook/native-sample native-sample \ native-sample.pngYou can change the binary from Device-Release/native-sample or Device-Debug/native-sample (the BlackBerry PlayBook tablet) to Simulator/native-sample to run the sample application on the simulator.