Performance monitoring in all QA tests

Performance monitoring in all QA tests

What to expect after following this guidance:

  1. You should be able make build for your game that can be distributed to the team.
  2. Performance data will be seamlessly monitored in every test your team executes.
  3. You will receive notifications if the game doesn’t meet the target.

If you have any issues or questions with the integration, please feel free to contact our support team via

Add GameBench SDK package to manifest


Add com.gamebench.sdk to dependencies with file:path/to/sdk.tgz

Generate a JSON configuration file and write it into the project directory
  "serverendpoint": "https://<gamebench server base URL>/v1/sessions/import",
  "emailaddress": "<project user>",
  "sdktoken": "<project token>",
  "tags": "foo=bar,baz=bat"

You can use tags to add information like branch name, build number, etc. for future data aggregation.

Build script

Add Autobuilder.cs script to project

using System;
using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;
using UnityEditor.iOS.Xcode.Extensions;
using System.Text.RegularExpressions;
#if UNITY_2020
using UnityEditor.AddressableAssets;
using UnityEditor.AddressableAssets.Settings;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;

class Autobuilder
    static string IOS_TEAM_ID = "{{APPLE_DEVELOPER_TEAM_ID}}";
    static string APP_ID = "com.gamebench.trashdash";
    static string[] SCENES = { "Assets/Scenes/Main.unity" };
    static string APK_DEST_PATH = "/path/for/app.apk";
    static string IOS_OUTPUT_DIR = "/path/for/ios/output";

    private static void processPendingAction(string action)
        bool isAndroid = (action == "buildAndroid");
        string buildPath = isAndroid ? APK_DEST_PATH : IOS_OUTPUT_DIR;

        // Configure the build
        BuildTarget target = isAndroid ? BuildTarget.Android : BuildTarget.iOS;
        BuildTargetGroup group = isAndroid ? BuildTargetGroup.Android : BuildTargetGroup.iOS;
        PlayerSettings.SetApplicationIdentifier(group, APP_ID);
        PlayerSettings.SetScriptingBackend(group, ScriptingImplementation.IL2CPP);
        PlayerSettings.SetApiCompatibilityLevel(group, ApiCompatibilityLevel.NET_Standard_2_0);
        if (isAndroid)
            PlayerSettings.Android.minSdkVersion = AndroidSdkVersions.AndroidApiLevel21;
            PlayerSettings.iOS.appleEnableAutomaticSigning = true;
            PlayerSettings.iOS.targetDevice = iOSTargetDevice.iPhoneAndiPad;
            PlayerSettings.iOS.appleDeveloperTeamID = IOS_TEAM_ID;

        // Do the build. This can take a while!
        BuildPipeline.BuildPlayer(SCENES, buildPath, target, BuildOptions.Development);

        // Exit the editor if in batch mode
        if (Application.isBatchMode)

    private static void StartBuild(string action) 

    static void PerformAndroidBuild()

    static void PerformIosBuild()

Start the Unity build using the command line


<path to Unity binary> \
    -batchmode \
    -executeMethod PerformAndroidBuild \
    -email <email> \
    -password <password> \
    -projectPath <project path> \
    -buildTarget Android \
    -logfile \


<path to Unity binary> \
    -batchmode \
    -executeMethod PerformIosBuild \
    -email <email> \
    -password <password> \
    -projectPath <project path> \
    -buildTarget iOS \
    -logfile \

To generate an IPA, you’ll need to run the following additional commands in the iOS output directory:

xcodebuild -scheme Unity-iPhone archive -archivePath /path/to/build.xcarchive

Example plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
        <string>{{your Apple team ID}}</string>
xcodebuild -exportArchive -archivePath /path/to/build.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath /path/to/ipa/dir
Last updated on