Package your 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.
Open a command prompt.
Navigate to the folder where your SWF application and XML configuration files are stored.
Type the following command to package your application:
blackberry-nativepackager [<commands>] [<options>] bar-package [app-desc files]
- a path for the output BAR file
- a path to the application descriptor file (bar-descriptor.xml)
- paths to files or directories to include in a package.
- package assets into a unsigned BAR file (default)
- install the package
- launch the application (without installing)
- list all files in the resulting package (for debugging of packaging issues)
- print BAR manifest (for debugging of packaging issues)
- install debug token to the device
- request and generate new debug token using device PIN
- request and generate debug token using PIN from existing token, replacing it
- sign the package for publishing (requires an Internet connection)
- -target format
- specify a target format, either bar or bar-debug. Debug format implies a debugger connection on startup.
- -buildId ID
- set the build ID (the fourth segment of the version). Must be a number from 0 to 65535
- -buildIdFile file
- set the build ID from an existing file, save new incremented version to the same file
- package in development mode; required to run unsigned applications and access application data remotely
- -debugToken token
- use debug token credentials to generate author and authorId (only usable with -devMode.
- -keystore store
- specify a path to a keystore file, default is C:\Users\user\.keystore
- -storepass password
- specify the password for the certificate store
- -C dir
- use dir as a root directory. All files that follow will be used with tail paths in the final package.
- -e file path
- save a file with the specified path in the package
- -device deviceId
- specify the IP address of the target
- -password password
- specify the device password
- print version
- print advanced options
- print the usage information
You can also specify the options and commands in a file, with one command-line argument per line by using the @ options_file option.
blackberry-nativepackager -package out.bar -devMode bar-descriptor.xml mybinary -C /tmp /tmp/locale/This example creates a development BAR file (out.bar) in the /tmp directory with assets mybinary and /locale.
blackberry-nativepackager -package out.bar -buildId buildId.txt -sign -storepass 123456 bar-descriptor.xml mybinary icon.pngThis example creates a signed BAR file (out.bar) for publishing with assets mybinary and icon.png.