Ios test basis 4: crash log analysis
Analyze and parse the crash log of the iOS application crash to obtain the suspicious code, precise to the class and code line; 1. first, get the crash log after the crash on the phone. There are many methods. Here we will introduce one. Connect your mobile phone to xcode and click xcode-Window-Devices, as shown in, to find the corresponding time point, right-click the crash Log information generated by the application, and select Export Log to save it to a directory. In this way, the crashlog file contains the application name, log.crashboard, 1.jpg2.jpg 2. second, obtain the information generated when the application is packaged. how to find the xcarchive file: xcode-Window-Organizer. After the file is opened, you can view the Archives list of all packages, find the Archives file corresponding to the crash package, Right Click show in finder, this file is "Application name + time. xcarchive "; 3. note: Put the two files obtained in step 1 and Step 2 in the same directory. 4. enable mac Terminal And enter the command line. The result of executing this command line is the corresponding class file name + the error code line number. In general, it is quite accurate .. After the atos-o file 1-arch arm64-l address 1 and address 2 are run, the result is as follows: Class Name and code line number information. It is quite concise to locate the cause of crash. 4.png command line: Source of file 1: Select File "Application name + time. xcarchive "-- Right-click to display the package content --" dSYMs "--" Application name. app. dSYM "--" Contents "--" Resources "--" DWARF "--" Application name "; --- the" Application name "is file 1, which can be dragged directly to the terminal; address 1 and address 2: Double-click to open the file "Application name + time + log. crash "-- find the Last Exception Backtrace, the Last Exception stack information, and find the logs related to the name of the crashed application in the information. As shown in, the red box shows the name of the crashed application, the following red arrow points to address 1, and the blue arrow points to address 22.163.jpg.