Instrumenting iOS Applications in Xamarin Studio

Applies to TestExecute 15.40, last modified on May 21, 2024

This topic describes how to prepare iOS applications in Xamarin Studio for testing.

Do not submit instrumented applications to the App Store. Instrumented applications use private APIs and will be rejected. Create a separate build configuration for test builds.

Supported Applications

Information in this topic applies to Xamarin.iOS applications created in Xamarin Studio 6.1.1 - 6.2.1.

Requirements

  • A Mac computer with Xamarin Studio 6.1.1 - 6.2.1, iOS SDK and an iOS development license.

  • Access to a Windows computer with TestComplete installed.

1. Create a Separate Configuration for Testing

To keep your build configurations intact, create a new configuration for testing:

  1. Open your application project in Xamarin Studio.

  2. Open the project’s Options and then select Build | Configurations.

  3. Create a new configuration for testing or copy an existing one:

    Creating a new build configuration for testing

    Click the image to enlarge it.

    Give the configuration a name indicating that it is for testing only.

2. Add the TestComplete Agent Library to Your Project

Note: If your application was prepared for testing with an earlier version of the TestComplete Agent library, you will not be able to test it with newer versions of TestExecute. To avoid the issue, recompile the application with the library that is shipped with the TestComplete version that matches your TestExecute version.
  1. On a Windows computer with TestComplete installed, find the following file:

    <TestComplete>\Bin\Extensions\iOS\libTestComplete-agent-static.a

    Copy or send this file to your Mac.

  2. On your Mac, place the library file in the folder where your application project resides.

  3. In Xamarin Studio, right-click your application project in the Solution Explorer and then click Add | Add Files:

    Adding TestComplete library file to the application project

    Click the image to enlarge it.

  4. In the resulting dialog, browse for the copied TestComplete Agent library file - libTestComplete-agent-static.a.

  5. Select the added TestComplete library file in the Solution Explorer and set its build action to None:

    Configuring properties of TestComplete library in the application project

    Click the image to enlarge it.

3. Change Build Settings

  1. Open Options of your application project:

    Configuring options of the application project

    Click the image to enlarge it.

  2. Select Build | iOS Build. Make sure your test configuration is selected:

    Selecting test configuration

    Click the image to enlarge it.

  3. In the Additional mtouch arguments text box, enter the following:

    -gcc_flags "-L${ProjectDir} -force_load ${ProjectDir}/libTestComplete-agent-static.a"

    Linking TestComplete library

    Click the image to enlarge it.

4. Create an IPA File

  1. In Xamarin Studio, select your application project and then click Archive for Publishing:

    Archiving the application

    Click the image to enlarge it.

  2. Select the archived application and click Sign and Distribute:

    Signing the application

    Click the image to enlarge it.

  3. In the resulting dialog, select Add Hoc. Then select the provisioning profile you want to use:

    Selecting the provisioning file

    Click the image to enlarge it.

    Getting the Provisioning File

  4. After specifying all the required parameters, click Publish.

  5. In the Output IPA file dialog, specify the name and location of the IPA file to create:

    Creating the IPA file

    Click the image to enlarge it.

5. Deploying the IPA File to a Device

You can either deploy the signed IPA file to your device manually, or add the file to your TestComplete test project and configure TestComplete to deploy the application to the test device during the test run automatically:

  1. Copy or send the signed IPA file from your Mac to the TestComplete computer.

  2. Add this IPA file as a tested application to your TestComplete project.

  3. Configure your TestComplete project to deploy the application to the test device during the test run automatically.

To learn how to do it, see the Deploying iOS Applications to Devices section in the TestComplete documentation.

Other Preparatory Actions

Before testing your iOS application with TestComplete, you also need to configure the TestComplete computer. For more information, see Preparing for Running Tests on iOS Devices.

See Also

Preparing iOS Applications
Preparing Test Computers for iOS Testing
Preparing iOS Devices

Highlight search results