When the IOS program encounters a crash condition in the real machine running program, the machine automatically generates a log file, which contains the running logic before the program crash, and analyzes the carsh file, it effectively solves the problem of the Program on the real machine and ensures the stability of the program. However, most of the crash files show the problematic addresses and system messages, unable to view the corresponding crash location in the program. The following article will help you solve this problem.
Analyze the cause of the crash. Three things are required: first, the crash file, second, symbolicatecrash, and third, dysm and app files.
0. Create a temporary folder on the desktop, such as crash
1. first, you need to export the crash file from the device. The simplest and most direct method is to connect the device to the mac, open the xcode organizer, select the devices at the top of the device, and in the List on the left, the device information of the current connection is displayed. Select the device logs under the current device. Wait for a moment. A lot of panic information will appear in the middle list, sort by time to find the crash that has crashed recently, and right-click to export the file. the file name is automatically saved. crash file, like: xxx_2013-08-15-200743 _-iPad. crash: Upload the file to the Temporary Folder created in step 1 for backup.
2. symbolicatecrash is a tool that comes with xcode. To facilitate calling, you can make a shortcut to call it in any path.
First, enter find/Applications/Xcode. app-name symbolicatecrash-type f under termail to find the true location of symbolicatecrash,
Generally, the following path is returned:
/Applications/Xcode. app/Contents/Developer/Platforms/iPhoneOS. platform/Developer/Library/PrivateFrameworks/DTDeviceKit. framework/Versions/A/Resources/symbolicatecrash
Next, create a shortcut
Sudo ln-s "/Applications/Xcode. app/Contents/Developer/Platforms/iPhoneOS. platform/Developer/Library/PrivateFrameworks/DTDeviceKit. framework/Versions/A/Resources/symbolicatecrash "/usr/local/bin/symbolicatecrash
3. the dysm file exists on the machine where the last package is sent. Open the xcode organizer and select archives on the top to view the final package sending record. Select distriive and save it as the corresponding archive file to view the package content, there is what we need. dSYM File
The app file is saved as an ipa file in the same way. Change the file name extension to zip. After decompression, you can obtain the final app file. Upload the two files to the Temporary Folder created in step 1 for backup.
Everything is ready, except the last step. In termail, enter the Temporary Folder created in step 1,
Run the symbolicatecrash xxxx. crash xxxx. dsym> crash. text command to save the last analyzed file to the crash. text file.
Like symbolicatecrash xxx_2013-08-15-200743_iPad.crash xxxx. app. dSYM> crash. text
Note: In general, the first use of symbolicatecrash will generate an error, the following error message
Error: "cmd_dir" is not defined at/usr/local/bin/symbolicatecrash line 53.
The solution is to enter export _dir = "/Applications/XCode. app/Contents/Developer