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.
If you attach a device over USB or launch the simulator, the tools will auto-detect those targets. You only need to set a test target manually 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 targets using the SDK web tool
To set up a test target:
- Open BlackBerry WebWorks <version>. A new browser window opens, displaying the BlackBerry 10 WebWorks SDK web tool.
- In the navigation panel, click Target Management.
- In the Target Name field, specify a unique name for the target.
- In the Target IP field, specify the IP address of the device or simulator. For information on how to locate the IP address, see Find the IP address for your target.
- In the Target Password field, specify the password for the device or simulator.
- In the Target PIN field, specify the PIN of the device or simulator.
- In the Target Type drop-down, specify whether the test target you've defined is a BlackBerry 10 device, or a BlackBerry 10 Device Simulator.
- Click Update Target List.
The target is added to the target list. You can remove or edit the values for any of your test targets at any time.
Set up targets from the command line
Set up your simulator or device as a target
To set up your device or simulator as target:
- On the command line, run the following
command:
webworks target add <target_id> <ip-address> [ -t device | simulator] [-p <password>] [--pin <device-pin>]
webworks target add mysim 192.168.180.130 -t simulator --pin FFFF9B90
Check the table below for details for each parameter.
Parameter | Description |
---|---|
<target_id> |
A unique name for the target. |
<ip-address> |
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. |
Removing a target
To remove an existing target:
- On the command line, navigate to your project folder.
- Run the following
command:
webworks target remove <target_id>
Viewing existing targets
To view a list of existing targets:
- On the command line, navigate to your project folder.
- Run the following command to view your list of
targets:
webworks target
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:
- On the home screen, swipe down from the top of the screen or find the Settings app on your home screen.
- Navigate to Settings > About.
- In the Category drop-down list, click Network.
- 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:
- Start the BlackBerry 10 Device Simulator.
- In the lower-left corner of the simulator window, note the IP address:
Last modified: 2014-10-09
Got questions about leaving a comment? Get answers from our Disqus FAQ.
comments powered by Disqus