Skip to main content

Adding the TestFairy SDK to your App

The TestFairy SDK helps you understand how users interact with your app. It can handle problems like crashes and on-screen error messages and integrate with your current development workflow.

TestFairy SDK features include:

  • Recording videos of how users interact with your apps.
  • Handling crashes and exceptions.
  • Sending logs to the TestFairy dashboard for later inspection.
  • Identifying and tagging users for searching and custom reports.
  • Auto updates to ensure your users are on the latest version.

Supported Platforms

To add the TestFairy SDK to your app, see the instructions for the relevant development platform:

Adding Events

Events are used to provide insights into how testers use your apps. They can help you track when a tester reaches key points in your app, such as visiting the in-app store.

To add an event to your timeline:

TestFairy.addEvent("<event name>");

Example

public class MyActivity extends Activity {
private void onPurchaseComplete() {
TestFairy.addEvent("Purchase OK");
}
}

Attaching Files To Sessions

TestFairy allows developers to attach files to sessions. As a developer, you can upload up to five files to a given session, with a maximum size of 15MB per file. Files must be local to the device.

Be sure to check the device logs for any problems uploading files. Only file extensions .jpeg, .jpg, .png, .txt, and .sqlite are supported.

To attach a file to a session, call the static instance method attachFile in the TestFairy class:

File file = ...
TestFairy.attachFile(file);

Example

File file = new File("/path/to/file.txt");
TestFairy.attachFile(file);