Suggest an edit


  1. Download the latest TestFairy plugin for Unity.

  2. Unpack the zip on your disk.

  3. Drag TestFairy.cs, iOS and Android into your Project under Assets/Plugins. If you don't have Plugins, you can drag the entire folder onto your project.

    Step 1

  4. Open mainCamera in Inspector by clicking on it, and then click on Add Component. Note: you can add TestFairy script to any game object. TestFairy is a singleton so no harm is done.

    Step 2

  5. Type in the name of the script, for example mainCameraScript, choose CSharp and click on Create and Add.

    Step 3

  6. Edit the newly created CSharp script, and add using TestFairyUnity; to the import section, and a call to TestFairy.begin() with your app token. You can find your app token in Account Settings page.

    Step 4

    Here is the code again, for easy copy-pasting:

    using UnityEngine;
    using System.Collections;
    using TestFairyUnity;
    public class mainCameraScript : MonoBehaviour {
     // Use this for initialization
     void Start () {
  7. At minimum, TestFairy requires the INTERNET and ACCESS_NETWORK_STATE permission for your Android build. You can copy a version of your AndroidManifest.xml from <root>/Temp/StagingArea/AndroidManifest.xml into <root>/Assets/Plugin/Android directory. From here, edit AndroidManifest.xml with the following line

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

    Additional features may require extra persmissions given below

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.BATTERY_STATS"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.GET_TASKS"/>
    <uses-permission android:name="android.permission.READ_LOGS"/>
  8. Save, build and run.

Setting Screen Name

TestFairy can capture screenshots during a recorded session. It attempts to autmatically name a screenshot based on different measures. In order to override this you can invoke setScreenName, and set your own name for a captured screen. setScreenName expects a String, so developers are free to label screenshots with any label appropriate. Some developers make use of the level name to set the screenshot. For example

using UnityEngine;
using System.Collections;
using TestFairyUnity;
using UnityEngine.SceneManagement;

public class cameraScript : MonoBehaviour {
    void OnLevelWasLoaded(int level) {