In this lesson, you learn how to instrument the
application under test (AUT). During this process, you also add the
AUT to the test workbench and install the AUT on one or more devices,
including the devices of other team members.
Before you start this lesson, verify that the following
requirements are met:
- Verify that you have a Macintosh computer with the Xcode project
for the AUT. For iOS instrumentation to succeed, you must be able
to compile the Xcode project for the AUT from the command line. For
further details about compiling Xcode projects, see the manual page
for xcodebuild in the Apple Developer Library.
- Verify that you completed the steps in Lesson 1: Setting up the test environment.
- Verify that the test workbench is
running.
- Verify that at least one iOS device is connected to a Macintosh
computer through the USB port.
If you meet these requirements, you can instrument the AUT
and install it on iOS device, or you can deliver the AUT to other
team members for testing. If you do not have a Macintosh computer
and the source code for the AUT, proceed to Lesson 3: Installing an instrumented application on an iOS device,
where you will learn how to install an application that was instrumented
by someone else.
To prepare the AUT for testing:
- On a Macintosh computer, download the RTW-iOS-Build-Archive.zip build
archive.
The build archive contains scripts that are
needed to prepare the application for testing.
- Open a browser window on the Macintosh computer and
enter the Workbench URL in the following format:
http://Workbench_URL:port/mobile
For
example, enter http://192.0.2.24:7878/mobile
- In the Rational® Test
Workbench - Mac OS Welcome page, follow the online instructions to
download the archive.
- When the download is complete, unpack the build archive.
The following folders are included in the build archive: browser,
build-script, client, runtime, runtime-bundle
- Instrument the AUT by running the rtwBuildXcode.sh script
and specifying on the command line both the Workbench URL and the device option.
You can specify the Workbench URL of your own computer to
add the instrumented AUT to your test workbench, or you can specify
the Workbench URL of another team member to add the instrumented AUT
to their test workbench.
With the device option, you can install the instrumented
AUT on any USB-connected device.
The rtwBuildXcode.sh script
provides support for both Xcode projects and Xcode workspaces.
Note: You must have the appropriate permissions to run the
script. If necessary, run the chmod command to
change permissions.
- On the Macintosh computer, open the Macintosh Terminal
application.
- Type the following command to instrument the AUT and
send it to the test workbench as
an incoming application and to a USB-connected device.
unpack_dir/build-script/rtwBuildXcode.sh .xcodeproj file Workbench URL device
Here
is an example of the command line syntax to instrument an AUT named UICatalog and
send it to the test workbench and
to all USB-connected devices:
./rtwBuildXcode.sh /Users/mario/iOSApps/UICatalog/UICatalog.xcodeproj/ http://9.54.119.136:7878 device
Alternatively,
you can use the simu option to send the AUT to
an iOS Simulator, or the both option to send
the AUT to all USB-connected devices and to an iOS Simulator.
Note: If
you did not use the device option with the rtwBuildXcode.sh script,
you can still add the instrumented version of the AUT to a mobile
device later.
After the script completes, the instrumented
AUT is visible in the Mobile and Web UI applications window, as shown
below:

- Add the instrumented version of the AUT
to a project in the test workbench.
Incoming applications must be managed to be used in a test,
that is, they must be added to a Test Workbench project
in the Rational Test Workbench Eclipse
Client. After you run the rtwBuildXcode.sh shell-script,
do one of the following tasks to manage the application:
- Click the incoming application button in the test workbench.
- In the Test Navigator, right-click an incoming application
under Mobile Incoming Applications and click Generate Managed
Application.
After you complete these steps, you can start recording a
test.