Setting up test targets

A test target refers to a BlackBerry device or simulator that you use to test your app. You can define one or more targets.

Targets are created outside of your project. Any targets you create are available for use by any projects you are working on. You can define as many targets as you have device or simulator PINs. In each case, you specify a unique target ID and associate that ID with a specific PIN. Then, when you deploy your app to a particular target device or simulator, you can simply refer to that target by ID.

You only need to set a test target if you want to deploy your app over Wi-Fi or when you have multiple simulators or devices that you want to test on.

Set up your simulator or device as a target

To set up your device or simulator as target:

  1. On the command line, run the following command:
    webworks target add <target_id> <ip-address> [ -t device | simulator]  [-p <password>]  [--pin <device-pin>]
For example, the following command defines the simulator as a target with an ID of mysim:
webworks target add mysim -t simulator --pin FFFF9B90

Check the table below for details for each parameter.

Parameter Description

A unique name for the target.


The IP address of the BlackBerry device or simulator.

-t device | simulator

The target type. If not provided, the default value is device.

-p <password>

The password for the device or simulator. This argument is required only if the device or simulator is password-protected.

--pin <device-pin>

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.

Find the IP address for your target

To create a target, you need the IP address of your device or simulator. To get the IP address, follow the steps below.

On a BlackBerry 10 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 > About.
  3. In the Category drop-down list, click Network.
  4. Under the Wi-Fi heading, note the value under IPv4. This is the IP address you should be supplying when setting up the device as a test target.

    To view the Wi-Fi section on the Network Settings page, you must have Wi-Fi turned on, and the device must be connected to the Wi-Fi network.

On the BlackBerry 10 Device Simulator:

  1. Start the BlackBerry 10 Device Simulator.
  2. In the lower-left corner of the simulator window, note the IP address:This image shows the location of the simulator IP address.

Removing a target

To remove an existing target:

  1. On the command line, navigate to your project folder.
  2. Run the following command:
    webworks target remove <target_id>

Viewing existing targets

To view a list of existing targets:

  1. On the command line, navigate to your project folder.
  2. Run the following command to view your list of targets:
    webworks target 

Last modified: 2014-03-10

comments powered by Disqus