Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[CB-4287] Update BB10 Readme file
  • Loading branch information
bryanhiggins committed Jul 17, 2013
1 parent 7173f3d commit 012c3188c3b25ff0a00d0730eaf4b3559c8c3793
Showing 1 changed file with 96 additions and 0 deletions.
@@ -51,3 +51,99 @@ To add a target, on the command line, type the following command:
where

- `<name>` specifies a unique name for the target.
- `<ip-address>` specifies the ip address of the BlackBerry device or emulator.
- `-t <device | simulator>` specifies the target type. If not provided, the default value is device.
- `-p|--password <password>` specifies the password for the device or emulator. This is required only if the device or emulator is password protected.
- `--pin <device-pin>` specifies the PIN of the BlackBerry device, which identifies that device as a valid host for the debug token. This argument is required only if you are creating a debug token.

###Remove a target

To remove a target, on the command line, type the following command:

<path-to-project>/cordova/target remove <name>

###Set a target as the default

To specify a specific target as the default, on the command line, type the following command:

<path-to-project>/cordova/target default <name>

Building your app
-----------------

To build your app, run the build script. You can build the app in either release mode or in debug mode.

- When you build the app in release mode, you are preparing it for distribution through BlackBerry World. The script packages your app resources and plugins together in a .bar file, then signs the app.
- When you build the app in debug mode, you are preparing it to be tested. The script packages your app resources and plugins together in a .bar file, but does not sign it. The script can also deploy the app onto a previously defined target. If you have not already created and installed a debug token, you can supply the keystore password, and the build script will create and install the debug token for you as well.

Debug mode also enables Web Inspector for the app, which allows you to remotely inspect the source code. A prompt displays the URL that you can use to connect to and inspect your app. For more information on using Web Inspector, see [Debugging using Web Inspector](http://developer.blackberry.com/html5/documentation/web_inspector_overview_1553586_11.html).

###Build your app in release mode

To build your app in release mode, on the command line, type the following command:

<path-to-project>/cordova/build release -k|--keystorepass <password> [-b|--buildId <number>] [-p|--params <params-JSON-file>]

where

- `-k|--keystorepass <password>` specifies the password you defined when you configured your computer to sign applications.
- `-b|--buildId <number>` specifies the build version number of your application. Typically, this number should be incremented from the previous signed version. This argument is optional.
- `-p|--params <params-JSON-file>` specifies a JSON file containing additional parameters to pass to downstream tools. This argument is optional.

###Build your app in debug mode

To build your app in release mode, on the command line, type the following command:

<path-to-project>/cordova/build debug [<target>] [-k|--keystorepass <password>] [-p|--params <params-JSON-file>] [-ll|--loglevel <error|warn|verbose>]

where

- `<target>` specifies the name of a previously added target. If `<target>` is not specified, the default target is used, if one has been created. This argument is only required if you want the script to deploy your app to a BlackBerry device or emulator and you have not created a default target. Additionally, if `<target>` is a device, then that device must be connected to your computer by USB connection or be connected to the same Wi-Fi network as your computer.
- `-k|--keystorepass <password>` specifies the password you defined when you configured your computer to sign applications. This password is also used to create your debug token. This argument is only required if you want the script to create and install the debug token for you.
- `-p|--params <params-JSON-file>` specifies a JSON file containing additional parameters to pass to downstream tools.
- `-ll|--loglevel <level>` specifies the log level. The log level may be one of `error`, `warn`, or `verbose`.

Note that all of these parameters are optional. If you have previously defined a default target (and installed a debug token, if that target is a BlackBerry device), you can run the script with no arguments, and the script will package your app and deploy it to the default target. For example:

<path-to-project>/cordova/build debug

Deploying an app
-------------------------

You can test your app using either a BlackBerry device or an emulator. Before deploying your app, you must first create a target for the device or emulator you want to deploy your app to.

The run script will first build your app. If you intend to deploy an app to a physical device for testing, you must first install a debug token on that device. If you specify the `--keystorepass <password>` argument when running the run script, the script will create and install the debug token for you. You do not need a debug token to test your app on an emulator, even if that app is unsigned.

To deploy your app to a device or emulator, on a command line type the following command:

<path-to-project>/cordova/run <target> [--no-build]

where
- `<target>` specifies the name of a previously added target. If `<target>` is a device, then that device must be connected to your computer by USB connection or be connected to the same Wi-Fi network as your computer.

- `-no--build` will use the most recently built version of the application rather than re-building. This is useful to test an application in release mode.

Adding and managing plugins
---------------------------

To add additional functionality that is outside of the core features of Cordova, you'll need to add plugins. A plugin represents a set of APIs that provide access to additional features of the platform.

In order to use a plugin, you must first add it into your project. Once added into your project, the plugin will be bundled with your project during the build process, to ensure that your app has access to all the APIs it needs.

###Add a plugin

To add a plugin, on the command line, type the following command:

<path-to-project>/cordova/plugin add <path to plugin>

###Remove a plugin

To remove a plugin, on the command line, type the following command:

<path-to-project>/cordova/plugin rm <name>

###View a list of installed plugins

To view a list of installed plugins, on the command line, type the following command:

<path-to-project>/cordova/plugin ls

0 comments on commit 012c318

Please sign in to comment.