Deploy to a BlackBerry 10 device
Before you begin:
- Make sure you have requested a debug token signing file (client-PBDT-xxxxx.csj) and registered it. If you haven’t requested and registered code signing keys, see Set up for signing BlackBerry 10 apps
- Make sure that your BlackBerry 10 device is on the same network as your computer. You might want to disconnect from VPN connections to avoid connection problems.
To deploy your application to the BlackBerry 10 device you first must package it with the debug token information.
- changing the version number of your application
- accessing the internet
- exporting a release build of your application
Debug tokens are valid for 30 days. When a debug token expires, the BlackBerry 10 OS no longer allows unsigned apps that rely on that token to run. You are limited to a total of 100 device PINs across all of your debug tokens that are currently active. If you create debug tokens that address 100 PINs, you must wait for some of your debug tokens to expire before you create more.
Create a debug token
- At a command prompt, navigate to dependencies\tools\bin in the BlackBerry 10 WebWorks SDK
- Create a
debug token for your device by using the following syntax and values for the command line
blackberry-debugtokenrequest -storepass <KeystorePassword> -devicepin <device PIN> <debug_token_file_name.bar>If you have mutliple devices you wish to test on, list their PINs in a file, and use the following command:
blackberry-debugtokenrequest -storepass <KeystorePassword> -devicepinlist <device_PIN_list_file> <debug_token_file_name.bar>
|KeystorePassword||The password you defined when you created your developer certificate.|
|device PIN||The PIN of the BlackBerry device on which you want to install this debug token.|
The name of a file containing the PINs of the BlackBerry devices on which you want to install this debug token. For example, a sample <device_PIN_list_file> called device_PINs.txt might look this:
12G34H56 2K672HVP 221Q2958
You would specify it like this:
The file name of the debug token you want to create. The debug token file must end with .bar. If you specify the name of an existing file, the blackberry-debugtokenrequest tool deletes the file before the tool creates the debug token.
If you specify a path that does not include a file name, the blackberry-debugtokenrequest tool deletes the directory you specify and does not create a debug token.
You can now distribute or install the debug token you created.
Install a debug token
- On the home screen of the BlackBerry device, tap the Settings icon to open the System Settings screen.
- In the list of options, select Security and Privacy.
- In the list of security options, select Development Mode to view the Development IP Address.
- At a command prompt, navigate to dependencies\tools\bin in your BlackBerry 10 WebWorks SDK folder.
- Type the following command:
blackberry-deploy -installDebugToken <path to debug token> -device <Development IP Address> -password <device password>
After the command executes, the result::success message displays indicating that you successfully installed the debug token.
Make the debug token available to the packager
- Create a copy of your debug token .bar file and name it debugtoken.bar.
- Move the debugtoken.bar file to the root of the BlackBerry 10 WebWorks SDK installation folder.
You can now load your debug-enabled application on a BlackBerry device without having to sign it.
Packaging your application with a debug token
To enable your unsigned application to run using a debug token, include the -d parameter when you package your application. This parameter packages your app in developer mode, which causes it to use the debug token that you installed on the device previously.
- At a command prompt, navigate to the installation folder for the BlackBerry 10 WebWorks SDK.
- Package the
app by using the following syntax:
bbwp [drive:][path]archive -d [-o dir]
bbwp C:\myapp\myarchive.zip -d -o C:\myapp\output
Mac OS example:
./bbwp ~/myapp/myarchive.zip -d -o ~/myapp/output
During the packaging process, the BlackBerry WebWorks Packager displays multiple messages, and indicates a successful packaging process if the application archive contains no errors.
- If successful, this process creates .bar files in the simulator and device folders in the folder specified by the -o parameter. If no -o parameter is specified, the .bar files are created in the simulator and device subfolders in the folder you ran the bbwp command.
Deploying your application to a BlackBerry 10 device
- Turn on Development Mode on your BlackBerry 10 device.
- Obtain the IP address of your BlackBerry 10 device.
- At a command prompt, navigate to the /dependencies/tools/bin folder for the BlackBerry 10 WebWorks SDK.
- Deploy the
application using the following syntax:
blackberry-deploy -installApp -password <device password> -device <IP_address> -package <BAR file path>
blackberry-deploy -installApp -password bb10devpw -device 192.0.2.1 -package myApp.barwhere the device password is bb10devpw, the IP address is 192.0.2.1, and the .bar file name is myApp.bar.