Configure your development environment

Before you can start developing for BlackBerry 10 OS, there are a few things that you need to do:

Register for code signing keys

Before you can test apps on a device or distribute apps on the BlackBerry World storefront, you'll need to register with BlackBerry to request an account and receive your code signing keys. You do not need code signing keys to test your app on a simulator.

When you request an account, you'll receive two CSJ registration files in separate emails:

  • A RIM Development Key (RDK), which you use to sign your applications
  • A debug token (PBDT) file, which you use to generate debug tokens
Debug tokens are for devices and aren't required for running an app on a simulator. They are valid for 30 days and when the token expires, the device no longer allows unsigned apps that rely on that token to run. To generate a new one, on the BlackBerry menu, select Debug Tokens and click Renew.

If you have already used the code signing keys to register another a BlackBerry 10 device or BlackBerry PlayBook tablet on your computer, you do not need to register a new set of code signing keys.

You can manage your code signing keys on the BlackBerry > Signing menu.

Screen showing the Code Signing Properties dialog.

  • Register: You must register before you can sign your app.
  • Unregister: Clicking this button removes your keys. You will need to request new keys before you can sign your app.
  • Backup: If you want to move your keys from one computer to another, use Backup. If you do not have a backup and you should lose your signing keys or forget your password, you will need to re-register with BlackBerry. After re-registering, new versions of your applications will appear as new applications and will not have access to shared data from previous versions.
  • Restore: Once you have moved your keys from one computer to another, use Restore.

To register for code signing keys:

  1. Fill in the form at BlackBerry Keys Order Form and click Submit. You should receive your BlackBerry Code Signing Keys within two hours.
  2. Once you receive your two CSJ files, save the registration files on your computer.
  3. In Microsoft Visual Studio, on the BlackBerry menu, select Signing.
  4. In the BlackBerry Signing Authority section, click Register.
  5. In the Registration window, complete the RDK CSJ Path field and the PBDT CSJ Path field by browsing to the location where you saved the CSJ files.
  6. In the CSJ Pin field, enter the PIN that you used to fill out the code signing keys request form.
  7. In the CSK Password field, choose a password. This is the keystore password that you use to create a developer certificate.
  8. Confirm the password and click OK.

Enable development mode

To upload and test applications on a device, you need to enable Development Mode on your device. This mode allows you to remotely install and launch an application. If you don't intend to do development activities, disable Development Mode for increased security. If you reboot a device, Development Mode should be disabled automatically.

By default, Development Mode is set to On or enabled for the simulator.

To enable Development Mode on your device:

  1. On the home screen, swipe down from the top of the screen or find the Settings app on your home screen.
  2. Navigate to Settings > Security and Privacy > Development Mode.
  3. Set the Use Development Mode toggle switch to On.
  4. If prompted, enter the password for your device, and tap OK.

Set a device target

You need to select which version of the BlackBerry 10 OS you are going to use and then set either a BlackBerry Device Target or a BlackBerry Simulator Target. This target is used when you build your solution. You can connect a device to Microsoft Visual Studio using Wi-Fi or with a USB cable.

  1. In Microsoft Visual Studio, on the BlackBerry menu, select Settings.
  2. In the BlackBerry NDK Settings section, in the NDK Path drop-down list, select the version of the BlackBerry 10 Native SDK you want to use to develop your app.
  3. If you are using a physical device, under BlackBerry Device Target, in the IP Address field, enter the IP address for the BlackBerry device attached to your computer.
  4. If you are using a simulator, under BlackBerry Simulator Target, in the IP Address field, enter the IP address for the simulator.
  5. Enter the password for your BlackBerry device or simulator.
  6. Click OK.

Screen showing the Settings dialog.

Install a debug token

A debug token allows you to deploy unsigned applications on a device. You do not need to complete these steps if you are using a simulator.

Before you complete these steps, ensure that you have requested signing keys. For more information, see Register for code signing keys. Also, make sure that you have set up your device target. For more information, see Set a device target. Note that you can only register one device at a time.

  1. In Microsoft Visual Studio, on the BlackBerry menu, select Debug Tokens.
  2. If you haven't set up your signing keys you will be asked to enter your password. In the Reset CSK Password dialog, enter your CSK Password, and click OK.
  3. In the Password successfully reset dialog, click OK.
  4. In the Debug Tokens dialog, click Add.
  5. Click Close.

Screen showing the Debug Tokens dialog.

If your application will no longer run on your device, your debug token may have expired. You can generate a new one using the same CSJ keys. To generate a new one, on the BlackBerry menu, select Debug Tokens and click Renew.