All Products
Search
Document Center

Add crash log

Last Updated: Jan 18, 2021

Crash logs record crashes of Apps. You can log in to the mPaaS console, and view crash reports in the Mobile Analysis Service > Performance Analysis page.

Tracking

Based on the mPaaS framework

If you have accessed the mPaaS framework (APMobileFramework repository available in the project), the crash reporting module automatically obtains crash logs and uploads the logs to the server. You only need to ensure that the crash monitoring is enabled after integrating the SDK. To ensure that crash logs are reported in time, it is recommend that you call the API marked in red in the following figure by using the main function.

Crash tracking

Based on a native project

If you haven’t accessed the mPaaS framework (APMobileFramework repository unavailable in the project), you need to enable the crash monitoring upon startup, and upload the crash logs after startup.

crash1

crashreport

Disaster recovery switch

By default, disaster recovery processing will be triggered when four consecutive crashes occur, and the files in the Documents directory will be cleared to avoid crashes caused by dirty data. In 10.1.60 and later versions, you can manually call the following interface to enable or disable disaster recovery processing.

 
  1. #import <MPMasAdapter/MPAnalysisHelper.h>
  2. /**
  3. * Enable or disable disaster recovery processing, enabled by default.
  4. */
  5. + (void)enableDisasterRecovery:(BOOL)enable;

Attentions

  • Only the crash logs of an App running on a real device are captured and uploaded to the log server. To debug crash monitoring, you should disconnect the Xcode and do not use a simulator.
  • To ensure that the version and product version in the crash log are consistent, you must set the bundle version and product version to the same version number in info.plist for the project.