In order for TestComplete to be able to test your iOS application, the application must be instrumented, that is, it must be prepared for testing in a special way.
To instrument your application, you compile it with the TestComplete-agent-static.a library and then validate the application by using certificate files:
the Apple WWDR file,
a developer certificate,
the PEM file,
a provisioning profile.
To learn more about instrumenting iOS applications, see About Instrumenting iOS Applications.
This topic describes how to get the required certificates files.
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.
To get the files, you must have access to the Mac computer where the developer certificate you want to use is installed.
If you do not have access to the Mac computer, you will have to ask the developer of your tested application to get the files as described below.
If you use the iOS Developer Program (not the iOS Developer Enterprise Program) to develop your tested application, the provisioning profile you will use for instrumentation must include the devices where you will run your tests. Register the devices before you start instrumenting your application:
We recommend that you use the iOS App Development profile for your applications. This way, you will be able to automate the deployment of the tested applications to your iOS devices and launching the applications on them with specific TestComplete scripting methods or keyword-test operations.
The Apple Worldwide Developer Relations (WWDR) certificate will link your development certificate to Apple, completing the trust chain for your application.
Download the certificate from the Apple web site:
Copy the file to your TestComplete computer.
To get a developer certificate, the PEM file and a provisioning profile, you can use the Certificate Exporter utility that is shipped with TestComplete. The utility is in the <TestComplete>/Bin/Extension/iOS/CertificateExporter.zip archive. To get the files by using the utility:
On the computer where TestComplete is installed, locate the Certificate Explorer utility archive:
Do not unpack the utility on a Windows machine. This will corrupt the utility.
Copy the archive to the Mac computer where the needed developer certificate and provisioning profile are installed.
Unpack the archive on the Mac computer.
Run CertificateExporter.app. It will show a list of available provisioning profiles.
Select a profile from the list. The utility will show you the assigned certificates in the list below.
Select the certificate you want to export and click Export.
Specify the directory to which you want to export the files.
If a dialog appears asking you to allow the utility to access your keychain, click Allow.
The utility will export the developer certificate, provisioning profile and the PEM file to the specified directory. To learn how to use these files to instrument your application, see below.
On the Mac computer where the needed developer certificate is installed, open the KeyChain Access application and switch to the Certificates category.
Right-click the needed developer profile and choose Export.
Make sure you are exporting the certificate in the .cer format and click Save:
This will export the developer certificate to a .cer file.
On the Mac computer where the needed developer certificate is installed, open the KeyChain Access application and switch to the Keys category.
Right-click the key associated with the developer and choose Export.
The PEM file must contain keys for the developer certificate you want to export. To make sure you are downloading the correct key, click the drop-down arrow. The expanded item should mention the same developer certificate that you exported earlier. See the image above.
Choose the Personal Information Exchange (.p12) format and click Save.
Enter the password to protect the items you are exporting and click OK. You will need this password later to convert the file to the PEM format. TestComplete does not need this password.
Enter your Keychain Access password and click Allow.
The .p12 file will be exported to the specified directory. Convert the exported file to the PEM format using the command line:
On your Mac, open the command line window and navigate to the folder to which you have exported the file.
Run the following command line:
openssl pkcs12 -in CertificatesPem.p12 -out Certificates.pem -nodes
Enter the password for the .p12 file you specified earlier.
The provisioning profile must belong to the same developer as the certificate and PEM file.
Download the provisioning file from Apple Member Center web site:
Open the following web page in your browser and login to the Member Center:
If you belong to several teams, Member Center will ask you to enter the team, whose settings you would like to view. Select the team and click Continue.
In the Developer Program Resources section of the next page, click the “Manage your certificates...” link:
This will invoke the Certificates, Identifiers & Profiles page.
Click Provisioning Profiles in the iOS Apps section.
On the subsequent page, select Provisioning Profiles | Development.
You will see a list of provisioning profiles of the development type:
Click the needed profile and click Download in the expandable section:
After you get all the required files, you are ready to instrument your iOS application:
If you are instrumenting your application in the TestComplete IDE or from tests:
Copy the files to your TestComplete computer.
Depending on how you instrument your application, specify these files in the Add Tested Application, Create New Project or Record Test wizard (see Instrumenting iOS Applications in TestComplete UI), or in your test (see Instrumenting iOS Applications From Scripts).
If you are instrumenting your application in Xcode or Xamarin Studio, follow the appropriate instructions: