• 1 Integration in Unreal
  • 2 Integration in System Native Layer (Android&iOS)
  • 3 Interfaces
  • 4.Android Additional Operations
  • 5.Integration Result Testing
  • 6.Upload Symbol Table

Unreal SDK Integration


This document applies to the latest version, Xbox, PS4, PS5, Switch and Linux platforms can refer to this document to integrate. Android, iOS and Windows platforms is recommended to refer to the stable version of Unreal SDK Integration Document

1 Integration in Unreal

1.1 Import CrashSight UE Plugin

    1. After creating a project on the platform, the SDK that matches the platform and engine of the project can be downloaded from the "Tutorial" in the sidebar, as shown in the figure below:
    1. Unpack Plugins files under the same directory. Copy the CrashSight directory in the Plugins folder to the Plugins directory under the UE project's root directory (if the folder doesn't exist, create it). Click [file] to refresh [Visual Studio project], then you will see CrashSight plugin code and directory structure in the Visual Studio project, as shown in the image.
    1. Compile CrashSight plugin source code and project source code together. When done, you can see the CrashSight plugin on the plugin editing page of UE editor, as shown in the image.

1.2 Add CrashSight to the dependencies

Add the following to Build.cs in the main project module:

PrivateDependencyModuleNames.AddRange(new string[] { "CrashSight" });

1.3 Execute Initialization

1.3.1 Android&iOS

  • About the method: Choose the first scene or the main scene, and call the following code in a script loaded as early as possible to initialize:
#include "CrashSightAgent.h" //Please include this header file
#if DEBUG
        CrashSightAgent::ConfigDebugMode (true);
#endif
// Set the domain name for reporting. Please fill in according to project publishing requirements. (required)
CrashSightAgent::ConfigCrashServerUrl("UploadUrl");
// Set the target APP ID for reporting and initialize. You can find the APP ID from More->Product Settings->Product Info of the management console. (required)
CrashSightAgent::InitWithAppId("AppID");  

  • Domain name for reporting

Domestic public cloud:

  • Android: https://android.crashsight.qq.com/pb/async
  • iOS: https://ios.crashsight.qq.com/pb/sync
  • Windows: pc.crashsight.qq.com

Overseas public cloud:

  • Android: https://android.crashsight.wetest.net/pb/async
  • iOS: https://ios.crashsight.wetest.net/pb/sync
  • Windows: pc.crashsight.wetest.net

1.3.2 Windows

  • About the method: Choose the first scene or the main scene, and call the following code in a script loaded as early as possible to initialize:
#include "CrashSightBridgeWin.h" //Please include this header file

CrashSight::CrashSightBridge::InitContext(UserId, AppVersion, CrashSightAppKeyForWindows);
// UserId and AppVersion can be decided by yourself according to your needs.

Windows platform also needs to add crash capture configuration. There are two options for crash capture configuration. For projects that can modify the engine, it is strongly recommended to use the solution in 1.3.2.1, which will provide more accurate crash reporting. For other users using the official engine version, use the configuration in 1.3.2.2.

1.3.2.1 Solution A
  1. In the engine source code \Engine\Source\Runtime\Core\Public\Windows directory, copy CrashSightReporter.h
  2. Introduce CrashSightReporter.h into the engine source code\Engine\Source\Runtime\Core\Private\Windows\WindowsPlatformCrashContext.cpp, and in the first line of the function ReportCrash (DefaultReportCrash under some macro configurations), call FCrashSightReporter::ReportCrashToCrashSight(ExceptionInfo);
  3. Compilation engine
  4. After initializing the function CrashSight::CrashSightBridge::InitContext, call CrashSight::CrashSightBridge::SetVehEnable(false)
1.3.2.2 Solution B
  1. Call CrashSight::CrashSightBridge::SetVehEnable(true) after initializing the function CrashSight::CrashSightBridge::InitContext
  2. Call CrashSight::CrashSightBridge::UnrealCriticalErrorEnable(true) after CrashSight::CrashSightBridge::SetVehEnable(true)

After the project is packaged, create a TQM64/dump directory and GameBabyConfig64.dat file in the same level directory as CrashSight64.dll. There are three parameters to be updated in the GameBabyConfig64.dat file:
1)GameName
2)Reported URL
3)APPID

<GameBabyConfig __version="1">
	<GameName>Test-Game.exe</GameName>
	<LobbyName></LobbyName>
	<IgnoreDllCnt>2</IgnoreDllCnt>
	<IgnoreDlls>TenSLX.dll</IgnoreDlls>
	<IgnoreDlls>Tensafe.dll</IgnoreDlls>
	<AppId>0620edc732</AppId>
	<DomainUrl>pc.crashsight.qq.com</DomainUrl>
</GameBabyConfig>

2 Integration in System Native Layer (Android&iOS)

Execute 1.1 and 1.2 of Integration in Unreal. Then initialize CrashSight in the native layer. The initialization reference code is as follows:
Android:

import com.uqm.crashsight.core.api.crash.UQMCrash;

...
//Fill in the configuration information first, this is only an example
System.loadLibrary("CrashSight");
UQMCrash.configDebugModeBeforeInit(true);//Enable debug
UQMCrash.setUserId("testUserId");//Set user ID
UQMCrash.setAppVersion("testVersion");//Set app version


//Then initialize CrashSight
UQMCrash.configCrashServerUrlBeforeInit("https://android.crashsight.wetest.net/pb/async");
UQMCrash.initWithAppId("******");

iOS:

#include "CrashSight/CrashSightCore.framework/Headers/CrashSightAgent.h"

...
//Fill in the configuration information first, this is only an example, specific configuration interfaces can be found in CrashSightAgent.h
GCloud::CrashSight::CrashSightAgent::ConfigDebugMode(true);//Enable debug
GCloud::CrashSight::CrashSightAgent::SetUserId("testUserId");//Set user ID
GCloud::CrashSight::CrashSightAgent::SetAppVersion("testVersion");//Set app version


//Then initialize CrashSight
GCloud::CrashSight::CrashSightAgent::ConfigCrashServerUrl("https://ios.crashsight.wetest.net/pb/sync");
GCloud::CrashSight::CrashSightAgent::InitWithAppId("******");

3 Interfaces

3.1 Platform-wide interfaces

3.1.1 Initialization

static void InitWithAppId(const char* app_id);

Note: Execute initialization. Initialize as early as possible to enable crash detection and reporting features. The appid is CrashSight's unique identifier for the item, and can be viewed in Product Settings -> Product Information.
Not available for Win, Xbox, Linux at this time

ParameterTypeNote
app_idconst char*APP ID of registered projects

3.1.2 Reporting errors

static void ReportException(int type, const char* name, const char* reason, const char* stack_trace, const char* extras, bool quit, int dump_native_type = 0, bool is_async = true, const char *error_attach_path = nullptr);

Note: Proactively report error messages. Can be called manually when an error is caught or needs to be reported, multi-threaded calls are supported. name, reason and stack_trace cannot be null.

ParameterTypeNote
typeintException Type, C#: 4, js: 5, lua: 6
nameconst char *Exception Name
reasonconst char *Exception Info
stack_traceconst char *Stack
extrasconst char *Other Info
quitboolWhether to quit
dump_native_typeint0: close, 1: call system interface dump, 3: minidump (valid for mobile only)
is_asyncboolasynchronous (valid for Win, Xbox)
error_attach_pathconst char *Absolute path of the attachment (GBK characters are not supported) (valid for Win, Xbox)
static void ReportExceptionW(int type, const char* name, const char* reason, const char* stack_trace, const char* extras, bool quit, int dump_native_type = 0, bool is_async = true, const wchar_t *error_attach_path);

Note:Report an Exception (Windows only)

ParameterTypeNote
typeintException Type, C#: 4, js: 5, lua: 6
nameconst char *Exception Name
reasonconst char *Exception Info
stack_traceconst char *Stack
extrasconst char *Other Info
quitboolWhether to quit
dump_native_typeint0: close, 1: call system interface dump, 3: minidump (valid for mobile only)
is_asyncboolasynchronous (valid for Win, Xbox)
error_attach_pathconst wchar_t *Absolute path of the attachment (valid for Win, Xbox)

View page:

paramsJson: Crash Details->Download Attachments->extraMessage.txt

dump: Crash Details->Download Attachments->trace.zip

Other: time used to report the error

AndroidiOS
Attachment sizeDump stackDo not dump stackDump stackDo not dump stack
100K[0.498881]s[0.003127]s[0.117762]s[0.001172]s
10K[0.464859]s[0.000730]s[0.115362]s[0.000445]s
1K[0.477934]s[0.000189]s[0.117078]s[0.000293]s

3.1.3 Setting user ID

static void SetUserId(const char* user_id);

Note: Setting user ID. The user id defaults to unknown.

ParameterTypeNote
user_idconst char *User ID

3.1.4 Adding custom data

static void AddSceneData(const char* key, const char* value);

Note: Set the Key-Value data customized by the user. It will be reported together with exception info when sending the crash. Each key shouldn't exceed 100 characters, each value shouldn't exceed 1000 characters, and the total length (all keys+all values) shouldn't exceed 64KB for Android, 128KB for iOS.

View page: Crash Details->Download Attachments->valueMapOthers.txt

ParameterTypeNote
keyconst char *Key
valueconst char *Value

3.1.5 Setting the application version

static void SetAppVersion(const char* app_version);

Note: Set app version number

For Android, the versionName property of AndroidManifest.xml file is used by default

For iOS, configure Info.plist, {CFBundleShortVersionString}.{CFBundleVersion} into the app version number.

Not available for Win, Xbox now

Note: Call it before the InitWithAppId interface.

ParameterTypeNote
app_versionconst char *Version Number

3.1.6 Reporting domain name settings

static void ConfigCrashServerUrl(const char* crash_server_url);

Note: Set domain name for reporting.

Not available for Win, Xbox now

Note: Call it before the InitWithAppId interface. The domain name of domestic public environment is as follows:

  • Android: https://android.crashsight.qq.com/pb/async
  • iOS: https://ios.crashsight.qq.com/pb/sync

A direct CrashSight domain name Integration is different from an indirect one using MSDK. Make sure you follow the above domain name to reconfigure. For other environment domain name, please consult the Integration contact.

ParameterTypeNote
crash_server_urlconst char *Target domain name of reporting

3.1.7 Set upload log path

static void SetLogPath(const char* log_path);

Note: Set an upload path for log after a crash. Read permission is required. On Android and iOS, this interface has a lower priority than logpath callback. Attachment paths with GBK characters are not supported on Windows.
Not available for Switch

ParameterTypeNote
log_pathconst char *Log absolute path
static void SetLogPathW(const wchar_t* log_path);

Note: Set an upload path for log after a crash. Read permission is required. Available for Windows only, supports attachment paths with GBK characters.

参数类型说明
log_pathconst wchar_t *Log absolute path

3.1.8 Enable Debug

static void ConfigDebugMode(bool enable);

Note: Whether to enable debugging mode. Off by default. After enabling, some logs will be printed, but it can help locate issues during tests.
Not available for Win、Xbox、Linux

Note: Call it before the InitWithAppId interface.

ParameterTypeNote
enableboolEnabling switch for debugging

3.1.9 Set device id

static void SetDeviceId(const char* device_id);

Note: Set the device ID, by default uuid is used as the device ID
Not available for Win、Xbox、PS4、PS5、Switch

Note: Call it before the InitWithAppId interface.

ParameterTypeNote
device_idconst char *Device ID

3.1.10 Set custom log reporting level

static void ConfigCrashReporter(int log_level);

Note: Set custom log reporting level. Off=0, Error=1, Warn=2, Info=3, Debug=4, default is Warn.
Not available for Win、Xbox、PS4、PS5、Switch、Linux

Note: Call it before the InitWithAppId interface.

ParameterTypeNote
log_levelintLog level

3.1.11 Customize logging

static void PrintLog(LogSeverity level, const char* format, ...);

Note: The custom log shouldn't exceed 30KB.

ParameterTypeNote
levelLogSeverityLog level
formatconst char *Log format
argsparams object[]variable arguments
static void PrintLog(LogSeverity level, const char* tag, const char* format, ...);

Note: Customized log with a limit of 30KB
Not available for Android、iOS、Linux

ParameterTypeNote
levelCSLogSeveritylog level
tagconst char *log tag
formatconst char *log format
argsparams object[]variable arguments

Custom log view:
Android, iOS, PS4, PS5, Switch: issue details->tracking log->custom log
Windows, Xbox, Linux: issue details -> custom log (from interface)

3.2 Mobile interfaces

3.2.1 Callback switches

static void ConfigCallbackType(int32_t callback_type);

Note: The callback switches for each type of reporting are currently 5 types of Type, represented by 5 bits. The first bit indicates crash, the second bit indicates anr, the third bit indicates u3d c# error, the fourth bit indicates js, and the fifth bit indicates lua, defaults to full on.

ParameterTypeNote
callback_typeint32_tcallback switch

3.2.2 Setting Android phone model

static void SetDeviceModel(const char* device_model);

Note: Set phone model

Note: Call it before the InitWithAppId interface.

ParameterTypeNote
device_modelconst char *Phone model

3.2.3 Report an error

static void ReportExceptionJson(int type, const char* exception_name, const char* exception_msg, const char* exception_stack, const char* params_json, int dump_native_type = 0, const char* errorAttachmentPath = "");

Note: Active reporting of error info, other information must be a Json string, an attachment can be specified to be uploaded.

ParameterTypeNote
typeintException Type, C#: 4, js: 5, lua: 6
exception_nameconst char *Exception Name
exception_msgconst char *Exception Info
exception_stackconst char *Stack
params_jsonconst char *Other Info, Json string of map code
dump_native_typeint0: close, 1: call system interface dump, 3: minidump
errorAttachmentPathconst char *Absolute path of the attachment

View page:

paramsJson: Crash Details->Download Attachments->extraMessage.txt

Native stack: Crash Details->Download Attachments->trace.zip

3.2.4 Reporting lightweight logs

static void ReportLogInfo(const char* msg_type, const char* msg);

Note: Reporting lightweight logs

ParameterTypeNote
msg_typeconst char *log Type
msgconst char *log message

3.2.5 Tagging scenes

static void SetScene(int scene_id);

Note: Set scene id.

ParameterTypeNote
scene_idintscene ID

3.2.6 Enable multi-signal capture

static void SetCatchMultiSignal(bool enable);

Note: Capture multiple signals from different threads and upload information about the first signal, which is turned off by default.

ParameterTypeNote
enableboolMulti-Signal Capture Switch

3.2.7 Enable report last frame

static void SetUnwindExtraStack(bool enable);

Note: Goes back up to 256 frames and reports the last frame even if the stack string is full, which is turned off by default.

ParameterTypeNote
enableboolReport last frame switch

3.2.8 Get crash thread ID

static long GetCrashThreadId();

Note: When a crash occurs, get the crash thread ID and return -1 on failure, can be called in a callback

3.2.9 Set custom device ID

static void SetCustomizedDeviceID(const char* device_id);

Note: Setting a custom device ID

ParameterTypeNote
device_idconst char*custom device ID

3.2.10 Get SDK-generated device ID

static void GetSDKDefinedDeviceID(void* data, int len);

Note: Get the device ID generated by the SDK

ParameterTypeNote
datavoid*Points to the memory used to hold the device ID
lenintLength of data

3.2.11 Set custom match ID

static void SetCustomizedMatchID(const char* match_id);

Note: Setting a custom match ID. The match id can be used to find crashes and errors in Advanced Search.

ParameterTypeNote
match_idconst char*match ID

3.2.12 Get SDK-generated session ID

static void GetSDKSessionID(void* data, int len);

Note: Get the session ID generated by the SDK. The session ID is used to uniquely mark a startup and is generally used in callbacks to determine if it is the same startup.

ParameterTypeNote
datavoid*Points to the memory used to hold the session ID
lenintLength of data

3.2.13 Get if last time was crash exit

static bool IsLastSessionCrash();

Note: Whether the last time was a crash exit, generally used in callbacks.

3.2.14 Get last user ID

static void GetLastSessionUserId(void* data, int len);

Note: Typically used with IsLastSessionCrash to get the last user ID in a callback

ParameterTypeNote
datavoid*Points to the memory used to hold the user ID
lenintLength of data

3.2.15 Set report thread count

static void SetUploadThreadNum(int num);

Note: Setting the number of reporting threads. The default is 3.

ParameterTypeNote
numintSet the number of reporting threads, default is 3

3.2.16 Set game type

static void SetGameType(int game_type);

Note: Set the game Type, Cocos=1, Unity=2, UE4=3, UE5=4

ParameterTypeNote
game_typeintgame Type

3.2.17 Get crash UUID

static void GetCrashUuid(void* data, int len);

Note: Get the UUID of the current report, the UUID is used to uniquely identify a report, usually used in callbacks.

ParameterTypeNote
datavoid*Points to the memory used to hold the crash UUID
lenintLength of data

3.2.18 Set logcat buffer size

static void SetLogcatBufferSize(int size);

Note: Set logcat buffer size, default 10KB in non-debug mode, 128KB in debug mode

ParameterTypeNote
sizeintlogcat buffer size

3.2.19 Start timed dump

static void StartDumpRoutine(int dumpMode, int startTimeMode, long startTime, long dumpInterval, int dumpTimes, bool saveLocal, const char *savePath);

Note: Start a thread to fetch the dump and report it at regular intervals. Depending on the settings of dump interval and number of dumps, there will be some performance overhead, generally used for testing. Please disable this feature before official release.

ParameterTypeNote
dumpModeintdump mode, 1: dump, 2: minidump
startTimeModeintStart time mode, 0: absolute time, 1: relative time, unit: milliseconds
startTimelongstart time
dumpIntervallongDump interval in milliseconds
dumpTimesintNumber of dumps
saveLocalboolWhether to save local
savePathconst char *Local Save Path

3.2.20 Get exception type number

static int GetExceptionType(const char *name);

Note: Get the exception type number based on the string of the exception name, which can be used to fill in the type parameter of the ReportException interface

ParameterTypeNote
nameconst char *Exception Type name, e.g. "c#", "js", "lua", "custom1", etc.

3.2.21 Setting callbacks

public static void SetCrashObserver(UQMCrashObserver *crashObserver)

Note: The callback function is called when a crash is detected. Customize the CSCrashCallBack class, inherit UQMCrashObserver, and implement the OnCrashExtraMessageNotify, OnCrashExtraDataNotify methods

ParameterTypeNote
crashObserverUQMCrashObserverUQMCrashObserver Integration

Example:

CSCrashCallBacks.h

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "UQMCrash.h"

/**
 * 
 */
using namespace UQM;

class CRASHSIGHTDEMO_UE_API CSCrashCallBacks : public UQMCrashObserver
{
public:
	CSCrashCallBacks();
	~CSCrashCallBacks();

	const char* OnCrashExtraMessageNotify();

	long OnCrashExtraDataNotify(const InnerCrashRet &crashRet);
};

CSCrashCallBacks.cpp

#include "CSCrashCallBacks.h"

CSCrashCallBacks::CSCrashCallBacks()
{
}

CSCrashCallBacks::~CSCrashCallBacks()
{
}

const char* CSCrashCallBacks::OnCrashExtraMessageNotify() {
    char str1[] = "this is extra message.";
    char *retValue = SAFE_MALLOC(strlen(str1) + 1, char); // 128*1024 characters at most. The exceeding part will be discarded
    strcpy(retValue, str1);
    return retValue;
}

long CSCrashCallBacks::OnCrashExtraDataNotify(const InnerCrashRet &crashRet) {
    char str[] = "this is extra data.";
    strcpy(crashRet.data, str); // Already assigned 128*1024 bytes of storage. No need to assign more. The exceeding part will be discarded
    return strlen(str);
}

OnCrashExtraMessageNotify's returned content for Android is on the "Crash Analysis-Trace Data-extraMessage.txt" page. OnCrashExtraDataNotify's returned content for Android is on the "Crash Analysis-Trace Data-userExtraByteData" page, Base64 code OnCrashExtraMessageNotify's returned content for iOS is on the "Crash Analysis-Trace Data-crash_attach.log" page. For iOS, the OnCrashExtraDataNotify interface isn't called

3.2.22 Set log upload callback

View page: Crash Details-Trace Data-Client Reporting Log

public static void SetCrashLogObserver(UQMCrashLogObserver *crashObserver)

Note: The callback function is called when uploading logs. Customize the MyCrashLogCallback class, inherit UQMCrashLogObserver, and implement the OnCrashSetLogPathNotify, OnCrashLogUploadResultNotify methods

ParameterTypeNote
crashObserverUQMCrashLogObserverSubclass of UQMCrashLogObserver

Example:

MyCrashLogCallback.h

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "UQMCrash.h"

using namespace UQM;
/**
 * 
 */
class UQMCRASHSIGHTTEST_API MyCrashLogCallback: public UQMCrashLogObserver
{
public:
	MyCrashLogCallback();
	~MyCrashLogCallback();
    
    // Set log path callback
    const char* OnCrashSetLogPathNotify(int crashType);

    //  Callback for notifying the log uploading results
    void OnCrashLogUploadResultNotify(int crashType, int result);
};

MyCrashLogCallback.cpp

// Fill out your copyright notice in the Description page of Project Settings.

#include "MyCrashLogCallback.h"

MyCrashLogCallback::MyCrashLogCallback()
{
}

MyCrashLogCallback::~MyCrashLogCallback()
{
}

// Set log path callback
// @param crashType Crash type, 0: Java crash, 2: Native crash
// @result Absolute path of log. If non-empty, it overwrites the path of SetCrashLogObserver interface
const char *MyCrashLogCallback::OnCrashSetLogPathNotify(int crashType)
{
    const char *path = "/data/data/packagename/app_crashSight/log.txt";
    return path;
}

// Callback for notifying the log uploading results
// @param crashType Crash type, 0: Java crash, 2: Native crash
// @param retust Log uploading result, 0: successful, other: failed
void MyCrashLogCallback::OnCrashLogUploadResultNotify(int crashType, int result)
{
}

3.3 PC, Xbox interfaces

3.3.1 Enable Veh exception handling

static void SetVehEnable(bool enable);

Note: VEH capture switch, on by default. It is recommended that all Unreal projects turn this switch on (no need to call it), otherwise it may generate crash misses.

ParameterTypeNote
enableboolVeh Exception Handler Switch

3.3.2 Proactive crash reporting

static void ReportCrash();

Note: Report a Crash. There are generally no usage scenarios, and can be used at your discretion depending on the needs of your project.

3.3.3 Proactive Dump Reporting

static void ReportDump(const char *dump_path, bool is_async);

Note: Active Dump reporting. generally no use scenarios, can be used as appropriate according to the needs of the project.

ParameterTypeNote
dump_pathconst char *dump path
is_asyncboolAsynchronous or not

3.3.4 Setting crash callbacks

static void SetCrashCallback(CrashCallbackFuncPtr callback);
ParameterTypeNote
callbackCrashCallbackFuncPtrCrash callback function pointer

The callback function is defined as:

typedef void (*CrashCallbackFuncPtr)(int type, const char *guid);
ParameterTypeNote
typeint崩溃的Type
guidconst char *Client Report ID

3.3.5 Enable additional exception catching

static void SetExtraHandler(bool extra_handle_enable);

Note: Set additional exception handling mechanism, default is off, consistent with old version. When turned on, it can catch crashes caused by illegal arguments thrown by safe functions such as strcpy_s, as well as crashes caused by purecall errors in dummy function calls.

ParameterTypeNote
extra_handle_enableboolAdditional Exception Handler Switch

3.3.6 Upload dump file

static void UploadGivenPathDump(const char *dump_dir, bool is_extra_check);

Note: Upload the dump file in the specified path.

ParameterTypeNote
dump_dirconst char *Dump file path
is_extra_checkboolJust fill in false by default

3.3.7 UE Critical Error upload

static void UnrealCriticalErrorEnable(bool enable);

Note: Set whether to report UE's Critical Error, the default is on. Unreal projects please turn it on. Android projects also need to Enable Critical Error reporting

ParameterTypeNote
enableboolUE Critical Error Reporting Switch

3.3.8 Enable Report Only the First Crash

static void OnlyUploadFirstCrash(bool enable);

Note: When turned on, only the first captured crash will be reported per startup, preventing duplicate reports. Effective only when VEH Capture is turned off

参数类型说明
enableboolEnable report only the first crash

3.4 PS4, PS5, Switch interfaces

3.4.1 Setting the error reporting interval

static void SetErrorUploadInterval(int interval);

Note: Setting the error reporting interval, the default is 30s.

ParameterTypeNote
intervalintError Reporting Interval

3.4.2 Error Reporting Switch

static void SetErrorUploadEnable(bool enable);

Note: Whether to enable error reporting, the default is on.

ParameterTypeNote
enableboolError Reporting Switch

3.5 Linux interfaces

3.5.1 Set path to all log files

static void SetRecordFileDir(const char* record_dir);

Note: Set the path to all log files, including SDK logs and dump files, defaults to the directory of the current executable.

ParameterTypeNote
record_dirconst char*Record file path

4.Android Additional Operations

4.1 Enable Critical Error reporting

On the Android platform, the Unreal engine sets the exit method for Critical Error to Normal Exit, making it not possible for CrashSight to capture this type of crash directly. In order to catch Critical Error, you need to find the UE engine code at the following location:


change

FPlatformMisc::RequestExit(true);

to

abort();

Critical Error for iOS exits with a crash, so no changes are needed.

4.2 Fix unwind issue in UE5.1 and later

Android projects packaged with Unreal engine 5.1 and later suffer from unwind crashes, causing native crash reporting to fail. If possible, please upgrade the engine to a newer version as soon as possible to completely eliminate this issue. Here is how to avoid the unwind crash issue by modifying the source code in Unreal Engine:

5.Integration Result Testing

CrashSight Test Interface

Test Java crash (Android)

static void TestJavaCrash();

Test Object-C crash (iOS)

static void TestOcCrash();

Test Native crash (Android, iOS, will support all platforms in the future)

static void TestNativeCrash();

Test OOM crash(Android、iOS)

static void TestOomCrash();

Test ANR (Android)

static void TestANR();

Test for using memory after release, only effective when GWP_Asan or MTE function is enabled (Android)

static void TestUseAfterFree();

5.1. Testing Method for iOS:

  • a. Enable Debug mode. Initialize CrashSight and assign suitable config parameters
  • b. Network and report: Check if "begin to upload <CSAnalyticsLogic" or "cmd: 641" is printed in the test device log
  • c. Crash detection: Check if "Handle the crash scene in callback" is printed in the test device log
  • d. Report exceptions: Check if "begin to upload <CSCrashLogic" or "cmd: 631" is printed in the test device log

5.2. Testing Method for Android:

  • a. Enable Debug mode. Initialize CrashSight and assign suitable config parameters
  • b. Network and report: Check if "[Upload] Run upload task with cmd: 840" is printed in the logcat log.
  • c. Crash detection: Check if "HandleSignal start" is printed in the logcat log
  • d. Report exception: Check if "[Upload] Run upload task with cmd: 830" is printed in the logcat log.

5.3. Testing Method for Windows:

  • a.Verify if CrashSight can connect to the internet and report normally. The verification process is:

    1. Initialize CrashSight;
    2. Wait 5 minutes and go to Exception Overview --> Crash Tendency --> Number of Devices Connected in the management console. The stats should be equal to or higher than 1.
  • b.Verify if a crash can be reported normally. The verification process is:

    1. Initialize CrashSight;
    2. You can trigger a crash in the game using the following code. (You can also use other bad memory access methods)
    int* a = 0;
    a[10000] = 5;
    
  • c.See if there is a generated dmp file under TQM64/dump. The crash is not successfully captured if you are unable to find the file. In this case, please contact CrashSight developer.

  • d.Go to "Crash Analysis" in the management console and see if there is a report with the corresponding time stamp. If you see the dmp file in step 3 but are unable to find the report in step 4, the crash was not successfully reported. Please check APPID config (Both config files need to be correct) and the APP KEY config if they correspond to each other and are the same in the application config. If it still fails to report using the correct config, please contact CrashSight developers.

  • e.Check if the version number and the user name of the crash report is the same as the configuration.

  • f.Check if the version number and the user name of the error report is the same as the configuration.

6.Upload Symbol Table

The above is an introduction to SDK Integration, crash reporting and verifying, but to see readable restored stacks on the page, you need to upload the corresponding symbol table. Please seeSymbol Table Uploading Tools Guide

Last Updated: