The project uses Umeng to count bugs. When a crash occurs, umeng provides the memory address where the crash occurred. Next, we use the memory address to locate the problem code. The article is from my book Jane: the original is here
1. Locate the dSYM of the uploaded version
Location of dSYM: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Go to DWARF in Resources under Contents.
2. Locate the terminal to the DWARF directory
On the command line, type CD DWARF directory path
cd/Users/circusjonathan/Library/Developer/Xcode/Archives/2017-04-27/HEKAI\ 2017-4-27\ 20.51. Xcarchive dSYMs/HEKAI. App. DSYM/Contents/Resources/DWARFCopy the code
3. Locate the fault
We usually see error messages like this on the UmENG problem statistics page
The blue font in the picture, preceded by the project name (HEKAI) error is the crash of the memory address in the terminal execute the following command:
Atos-arch [project set CPU Type] -o [project name] [memory address where the error occurred] [project name] + 255428
CPU Type can be viewed in Build Setting, which contains error information in umeng, as shown in the lower left corner of the image above: (CPU Type: arm64). If the CPU Type is incorrectly written, the problem cannot be located.
View the CPU Type in Build Setting
Type the command:
atos -arch arm64 -o HEKAI 0x10003e5c4 HEKAI + 255428
Copy the code
Press Enter will locate the crash
Visualization tool
Answer-huang has developed a tool that is specially used to quickly locate the code of crash log. The tool is particularly useful. The steps are as follows:
1. Drag the XCarchive file in the package to any position in the software window (multiple files can be dragged at the same time, note: the file name does not contain Spaces). 2. Select any version of the XCarchive file. The CPU types supported by the xCarchive file are displayed on the right. 3. Check whether the UUID displayed on the tool page is the same as the UUID displayed on the error page. 4. Enter the incorrect address in the tool text box and click Analyze.
Tool use: answerhuang.duapp.com/index.php/2… . Tools download links: download.csdn.net/detail/toto…