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.
1. Create a Separate Configuration for Testing
2. Add the TestComplete Agent Library to Your Project
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:
-
Open your application project in Xamarin Studio.
-
Open the project’s Options and then select Build | Configurations.
-
Create a new configuration for testing or copy an existing one:
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. |
-
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.
-
On your Mac, place the library file in the folder where your application project resides.
-
In Xamarin Studio, right-click your application project in the Solution Explorer and then click Add | Add Files:
-
In the resulting dialog, browse for the copied TestComplete Agent library file - libTestComplete-agent-static.a.
-
Select the added TestComplete library file in the Solution Explorer and set its build action to None:
3. Change Build Settings
-
Open Options of your application project:
-
Select Build | iOS Build. Make sure your test configuration is selected:
-
In the Additional mtouch arguments text box, enter the following:
-gcc_flags "-L${ProjectDir} -force_load ${ProjectDir}/libTestComplete-agent-static.a"
4. Create an IPA File
-
In Xamarin Studio, select your application project and then click Archive for Publishing:
-
Select the archived application and click Sign and Distribute:
-
In the resulting dialog, select Add Hoc. Then select the provisioning profile you want to use:
-
After specifying all the required parameters, click Publish.
-
In the Output IPA file dialog, specify the name and location of the IPA file to create:
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:
-
Copy or send the signed IPA file from your Mac to the TestComplete computer.
-
Add this IPA file as a tested application to your TestComplete project.
-
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