Crashlytics Android exception report statistics management (detailed explanation)

brief introduction

Crashlytic, founded in 2011, is a tool for mobile application developers to save and analyze application crash information. Users of crashlytics include: payment tool PayPal, comment application yelp, photo sharing application path, group purchase application Groupon and other mobile applications.

In January 2013, crashlytics was acquired by twitter and became another successful entrepreneurial product. After being acquired, we have more reason to use it to analyze application crash information because there are no unstable factors of start-ups.

The benefits of using crashlytics are:

1. Crashlytics will not miss any application crash information. Take my app for example, I can't see any crash information in the background of iTunes connect. However, users do feed back the application crash through microblog or customer service phone. These can be counted in crashlytics. The following screenshot shows the difference between my app in the background of Apple iTunes connect and crashlytics:

2. Crashlytics can manage these crash logs like a bug management tool. For example, crashlytics will automatically set the priority according to the frequency of each type of crash and the number of users affected. For each type of crash, crashlytics will not only provide call stack like general tools, but also display more relevant information helpful for diagnosis, such as whether the device escaped, the amount of memory at that time, the IOS version at that time, etc. For the crash log repaired, you can turn it off in the background of crashlytics. The following figure shows a crash record of my early application. After I repair it, I update it to the repaired state.

3. Crashlytics can summarize and send crash information to your email every day and every week, and all the information is clear at a glance.

Now I'll introduce you how to use crashlytics.

Use introduction to apply for account number

The service of crashlytics is provided free of charge, but it cannot be registered directly. You need to apply first. Open the official website of crashlytics and enter your own email to apply for use. As shown in the figure below:

After submitting the email, your application will be placed in the application queue of crashlytics, and the page will jump to the following interface. On the right side of this interface, you can provide more effective information to make crashlytics give priority to your application. It is recommended that everyone fill in more information.

If it goes well, you will usually receive an application from crashlytics in about 1-2 days. As shown in the figure below, you can jump to the registration interface through the email link and fill in the password to complete the registration.

Setup project

Before using crashlytics, you need to configure the original Xcode project. On this point, crashlytics is more considerate than any other SDK provider I have seen. Because crashlytics has specially made a Mac app to help you configure, you need to download the app here before configuring.

After the application is downloaded, run the application and log in to the account. Then select the "new app" button in the application, and then select the project you want to add crashlytics. Then the application of crashlytics will prompt you to add a run script for the project. If you don't know how to add it, here is a help document. The screenshot of the added project is shown below

Then, the local application of crashlytics will prompt you to drag the framework related to crashlytics into the project. As follows:

After following the prompts, the last step is reached. Add the following code to the didfinishlaunchingwithoptions method of appdelegate:

After that, run the program, and crashlytics will detect that your setting is successful. If you are interested, you can manually trigger a crash record to see if crashlytics can help you collect it. Use the following code

If you want to test the crash caused by an exception, you can use the following code:

After the application is published, you can view and modify relevant records in the background of crashlytics. In addition, crashlytics also supports importing data into other project management tools (such as redmine or JIRA), as shown below. The configuration is very simple.

Realization principle and application experience

In principle, crashlytics completes the upload and analysis of crash logs through the following two steps:

1. Provide application SDK. You need to call its SDK when the application starts to set up your application. The SDK will be integrated into your application to complete the collection and upload of crash information.

2. Modify the compilation configuration of the project, add a piece of code, and upload the corresponding dsym file of the project after each compilation of the project. Students who have studied manual analysis of crash logs should know that only through this file can crash logs be restored to readable call stack information.

Experience in use

In order to make it easier for developers to set up corresponding projects, crashlytics provides MAC applications to help you detect whether relevant projects are set correctly and provide corresponding help information. Later, I also found that the program will automatically help you upgrade the SDK files of crashlytics. Although this is very considerate, I personally don't think it's very friendly. After all, modifying the SDK will affect the internal logic of the application after compilation. When upgrading without any notice, I can't be sure whether crashlytics has done anything wrong. However, foreign services, especially those provided by relatively well-known companies such as twitter, are much more economical, so I'm still at ease at this point.

Using crashlytics can get you out of the trouble of managing application crash records. And help you find some major hidden bugs in the application. For example, in an application I wrote before, there was a cache expiration problem. This bug will be triggered only when the cache expires. Such a problem is difficult to trigger at the tester's side, because they can't understand the internal implementation details of your application. Through crashlytics, I have a clear understanding of the number and location of crash applications. Combined with my own development experience, it is easy to find the problem.

It is worth mentioning that the official documents of crashlytics are also very sound. If you encounter any problems in use, you can also go up to view the detailed documents.

May crashlytics make your applications more robust ~

The above statistical management of crashlytics Android exception report (detailed explanation) is all the content shared by Xiaobian. I hope it can give you a reference and support more programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>