# Access Guide
# 1. Tool download
Click on the SDK download pageDownload iOS SDK。
# 2.Import iOS SDK
- Drag the downloaded
libCrasheye.afiles into your XCode project as shown below:
💡 Or you can right-click your project in XCode and click Select.[Add Files to "xxxx"...]:
- Check [Copy items if needed] in the checkbox that pops up later, and make sure [Add To Targets] is checked for the appropriate target.
# 3.Configuration engineering
- Open your XCode project settings, expand [Link Binary With Libraries] in the [Build Phases] item, click the [+] button:
- Add [libz.dylib] and [libc++.dylib]:
- Add the compile option to the project again:
💡 iOS SDK version 2.5.0 and above, upload has been changed to https method, no need to add NSExceptionDomains or NSAllowsArbitraryLoads fields
Versions below 2.5.0 need to add exceptions by themselves.
# 4.Initialization SDK
Import the header file in the
AppDelegate.msource file of the project:
The SDK is initialized in the application: didFinishLaunchingWithOptions: method as follows:
If you need to specify channel information for your APP, you can also initialization like this:
[Crasheye initWithAppKey:@"Your_AppKey" withChannel:@"Your_Channel"]
👍 At this point, the SDK access on the iOS is complete. Launch the APP on your Apple device, and you can see the monitoring data in real time in the background of Crasheye.
# 5.TestPlease debug and verify on the real machine, and you can see the monitoring data in real time in the background of Crasheye.
Start your project and see the monitoring data in real time in the background of Crasheye!
# Common API
Set App version number
- Read the version information of the app by default, or you can set it yourself using this interface. Note: This method needs to be called before Crasheye init.
[Crasheye setAppVersion:(NSString *) appVersion];
Setting user identity
- Setting user identity for each reported record can facilitate later screening and positioning of problems. For example, developers can use this method if they want to see the crash information reported by their mobile phones：
[Crasheye setUserID:(NSString *) userID];
Add breadcrumbs (RBI information)
- You can add multiple breadcrumbs (RBI information) to your code and view the time and order of breadcrumbs (RBI information) on the Crasheye platform, so you can monitor whether your project runs according to your presets! Just call the following APIs in every place you want to monitor:
[Crasheye leaveBreadcrumb:(NSString *) breadcrumb];
Add customized data
- If you feel that the data captured by Crasheye by default is not enough to meet your requirements, you can add customized data, just call the following API:
[Crasheye addExtraDataWithDic:(NSDictionary *) dic];
Proactively report script errors
- This interface is mainly for developers to actively call. When exception information is caught, such as script exceptions such as lua and js, it can be reported to the server level through the call Interface. (In order to reduce repeated reporting, the same exception information can only be reported once within 10 minutes)
/* @param: errorTitle The title of the error, specified by the developer, cannot be empty exception The detailed content of the exception cannot be empty */ [Crasheye sendScriptExceptionRequestWithTitle:(NSString *) errorTitle exception:(NSString *) exception file:(NSString *) file language:(NSString *) language];
Get device ID
- This interface allows the user to obtain the device ID information of the current mobile phone. Through this ID information, the corresponding machine abnormality information can be found through page search.
Set up a test version
/** * Set whether this version is a test version * @param enabled Whether it is a test version (1 is enabled, 0 is disabled) */ [Crasheye setBeta:(int32_t) enabled];
# Symbol file upload
# Upload tool
Environmental requirements Java SE Runtime Environment (opens new window) 7 or above, only on Mac system
a. Symbol File Upload Tool
b. dSYM file (the file that contains debug information in the iOS) is located as follows:
XCode - > project engineering - > Products - > XXX.app - > Right-click "Show Folders" - > XXX.app. dSYM
|-veresion||Application version (optional), read from Contents/info.plist in symbol file by default|
|-Platform||default value is ios|
|-disableUpload||Do not upload symbol files|
|-Dumpsyms||dsym parser dump_syms location, default points to the current working directory symbol file path|
- Execute the symbol file tool to upload
Java -jar CrasheyeiOSSymbol.jar -appkey = the project's AppKey [-version = application version number] [-platform = ios] symbol file path
# Website upload
- Run the symbol file tool to generate a .zip file Java -jar CrasheyeiOSSymbol.jar -disableUpload symbol file path
- Upload through the Crasheye background web page (Settings - Symbol File - Symbol File Upload), and select the corresponding application version number.
- Upload successfully