Ios:crash Crash Log Analysis

Source: Internet
Author: User

First, preface:

As a qualified iOS developer, in addition to the ability to code strong coding, but also should have excellent error-checking ability. In the project run, the program crashes is unavoidable, encountered this problem, sometimes there will be a lot of crash log, 艹, seemingly do not understand AH. It's not that scary, but we can format the logs to quickly locate the problem and get it done quickly.

Second, analysis:

First, let's look at a crash log, which is a brief introduction to some of the key keywords:

Keyword Explanation:

2.1. Process information
The first part is information about the flashback process:

Incident Identifier: is a unique identifier for the crash report.

Crashreporter key: is a unique key value that corresponds to the device identity. Although it is not a true device identifier, it is also a very useful intelligence: if you see the Crashreporter key value of 100 crash logs is the same, or only a few different crashreport values, it is not a common problem, Occurs on only one or a few devices.

Hardware Model: Identifies the device type. If many crash logs come from the same device type, the app only has a problem with a particular type of device. In the above log, the crash log produced the device is the iphone 4s.

Process: Permissions on the operation of the project, which are readable and writable

Path: Paths to crash files

Identifier: Project identifier, which is the bundle Id

Version: Revision number

..... Wait a minute.......

2.2. Basic information
This section gives some basic information, including the date Date/time and time of the flashback occurred, the iOS version of the device, OS versions, and so on . Launch

2.3. Abnormal information
Exception type: Types of exceptions.
Exception Codes: Exception error code
Termination Reason: The reasons for the flashback, such as the common array out of bounds ah, or something.
Triggered by thread: The problem is in which thread, this is more important, first determine in which thread the problem, and then go to the location.

2.4. Thread Backtracking
This section provides a backtracking log of all threads in the app. Some of the thread calls, stack information, do not understand at all, all need to be symbolized processing.

Third, parsing the crash log

Use the Symbolicatecrash tool from Xcode to parse the. Crash file

3.1. Get crash file:
A. Obtain the method directly from the device as

B. If the product crashes during the shelves, the testers on Apple's side send us a list of the crash log files that have been sorted out, simply by solving the problem.

3.2. Locate the. dsym file that corresponds to the app package.

emphasize to correspond. DSYM is a transit file that holds the address mapping information for 16 of the binary functions, and the symbols that we debug are included in this file. and a new DSYM file is generated each time the project is compiled. test given to the. crash file, the exact statement and function portion of the crash are only 16 binary address symbols, not the xxx.cpp (xxfunction xx line) We see in Xcode debugging. General release of a version needs to save the corresponding. dSYM and. App packages for easy analysis of crash. :

3.3, is to find the Symbolicatecrash tool in Xcode, I use the Xcode8, the path is:

/applications/xcode.app/contents/sharedframeworks/dvtfoundation.framework/versions/a/resources/ Symbolicatecrash

Other versions of Xcode, their own Baidu, anyway, are similar. Copy the tools we need directly to the desktop (for your convenience).

3.4. Analysis of. Crash file
A. Configuring the environment variable Developer_dir (not required if configured)

Export Developer_dir=/applications/xcode.app/contents/developer

  B. Create a new folder and place the two files in the same folder in the second step

Note: The above refers to the path in which it is located. with the simple steps above, we can get a well-formatted crash log, which makes it easier for us to locate the bug. copyright belongs to author, original link: http://www.jianshu.com/p/e616d094cf65



Ios:crash Crash Log Analysis

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.