Integrating the TestFairy SDK into your app helps you better understand how your app performs on real devices. It tells you
when and how people are using your app, and provides you with any metrics you may need to optimize your user experience and code.

You get to:

  • Track app use.
  • Handle crashes and report to server.
  • Record screen video and other metrics.
  • Understand user flow, using checkpoints.
  • Grab NSLogs from client and report to server.
  • Automatically update if a new build is available (Ad Hoc only.)

Add the SDK

  1. Download the framework from our Download page.
  2. Unzip files and drag them into your project tree.

    alt

    Make sure Copy items if needed is checked when dragging files to your project.

    alt

  3. Add the following frameworks:

    • CoreMedia.framework
    • CoreMotion.framework
    • AVFoundation.framework
    • SystemConfiguration.framework
    • OpenGLES.framework

Add the TestFairy pod to your Podfile by inserting the following line where applicable:

                pod 'TestFairy'
            

Once you have Carthage installed, you can begin adding frameworks to your project. Note that Carthage only supports dynamic frameworks, which are only available on iOS 8 or later (or any version of OS X).

  1. Add github "testfairy/testfairy-carthage" to your Cartfile.
  2. Run carthage update.
  3. On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, drag and drop the TestFairy framework from the [Carthage/Build][] folder on disk.


  1. On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script in which you specify your shell (ex: bin/sh), add the following contents to the script area below the shell:

    /usr/local/bin/carthage copy-frameworks
                    

    and add the paths to the TestFairySDK frameworks under “Input Files”, e.g.:

    ${SRCROOT}/Carthage/Build/iOS/TestFairySDK.framework
                    

Initialize the SDK

  1. Open your AppDelegate.m file.

  2. Add this code to your app:

  1. Create an Objective-C bridging header

    Since this process only needs to be done once per project, if you have already done so, just update your bridging header file.

    • Right-click on your project, select New File...
    • Select Header File.h
    • Save as Bridging.h in your project
    • Click on Bridging.h to open it in editor
    • Add the following line to the code:
    #import "TestFairy.h"

    Update Build Settings with the new bridging header:

    • Click on your project
    • Select Build Settings tab
    • Select the "All" filter, in order to find Swift Compiler - Code Generation: Objective-C Bridging Header
    • Edit Swift Compiler - Code Generation: Objective-C Bridging Header (double-click to edit).
    • Drag "Bridging.h" from the source tree onto the edit box opened
  2. Open your AppDelegate.swift file.

  3. Add this code to your app:

Class Reference

https://app.testfairy.com/reference/ios/Classes/TestFairy.html

Troubleshooting

For more information about common problems when integrating the iOS SDK, please visit our FAQ page

Related documentation