IOS device Logs Analysis

Source: Internet
Author: User

The location of symbolicatecrash in xcode 4.3 is different from that in earlier versions.

/Applications/xcode. APP/contents/developer/platforms/iphoneos. Platform/developer/library/privateframeworks/dtdevicekit. Framework/versions/A/resources/

Before xcode 4.3

/Developer/platforms/iphoneos. Platform/developer/library/privateframeworks/dtdevicekit. Framework/versions/A/resources/symbolicatecrash

I. Problem generation

In xcode's window-> orgnizer-> device logs, you can see the program crash records on the connected iPhone (IPAD) device, but one crash record on the device can only be synchronized once,

Once the device logs is viewed on a Mac, the crash files on the device are stored on this mac.

Looking at the crash file from the device logs, you will find that sometimes the collapsed information contains the function name of the Code, but sometimes only the function address (as shown below). What is the problem?

Thread 0 crashed:
0 libobjc. A. dylib 0x300c87ec 0x300bb000+ 55276
1 mobilelines 0x00006434 0x1000 + 21556
2. cancelines 0x000064c2 0x1000 + 21698
3 uikit 0x30a740ac 0x30a54000 + 131244
4 uikit 0x30a66110 0x30a54000 + 74000
5 uikit 0x30a6565c 0x30a54000 + 71260
6 graphicsservices 0x00009b0b4 0x31696000 + 20660
7 graphicsservices 0x00009d818 0x31696000 + 30744
8 iomobileframebuffer 0x31f3e8f8 0x31f3d000 + 6392
9 com. Apple. Framework. iokit 0x30f342b8 0x30f30000 + 17080
10 corefoundation 0x3025ced4 0x30229000 + 212692
11 corefoundation 0x3025bed6 0x30229000 + 208598
12 corefoundation 0x3025b584 0x30229000 + 206212
13 graphicsservices 0x0000998e4 0x31696000 + 14564
14 uikit 0x30a5e308 0x30a54000 + 41736
15 uikit 0x30a671dc 0x30a54000 + 78300
16 kernel elines 0x00002090 0x1000 + 4240
17 cancelines 0x0000202c 0x1000 + 4140

Ii. cause of the problem

In fact, it is related to the two files after compilation: MyApp. app and MyApp. App. dsym. If the crashed program is compiled by this Mac

If the compiled app and dsym files are still in the build directory (that is, other updated versions have not been compiled), orgnizer will parse the function name of the crash file. If not, yes

The address is bald. At this time, even if the same code is compiled again, the code information cannot be parsed.The. app and. dsym files must be retained for the released version..

Iii. Solution

If there is only an address, as long as the. app and. dsym files are still present, the symbolicatecrash tool can parse the corresponding function name. Use the symbolicatecrash Tool

And. app and. dsym file. The method for parsing the function name is as follows:

1. Create a special directory for parsing, such as:/crash

2. Copy the symbolicatecrash tool from the original location to/crash. Because the finder in the framework cannot go in directly, you can use the command line tool to copy the file. The command is as follows:

$ CP/developer/platforms/iphoneos. Platform/developer/library/privateframeworks/dtdevicekit. Framework/versions/A/resources/symbolicatecrash/crash

3. Copy the corresponding. app and. dsym files to/crash, and then copy the crash files to be parsed to/crash.

4Assume that the crash file is a MyApp_2011-xxx-iPad.crash, The. dsym file is MyApp. App. dsym, and then put MyApp. app and MyApp. App. dsym file together, and then use the following command for parsing:

$./Symbolicatecrash MyApp_2011-xxx-iPad.crash MyApp. App. dsym> myapp_symbol.crash

If the resolution is successful, there will be a function name (as shown below). If the resolution fails, it is because the. app and. dsym files provided are inconsistent with the version of the crashreport.


Thread 0 crashed:

0 libobjc. A. dylib 0x300c87ec objc_msgsend + 20
1 cancelines 0x00006434-[boardview setselectedpiece:] (boardview. M: 321)
2 cancelines 0x000064c2-[boardview touchesbegan: withevent:] (boardview. M: 349)
3 uikit 0x30a740ac-[uiwindow sendevent:] + 264
4 uikit 0x30a66110-[uiapplication sendevent:] + 248
5. uikit 0x30a6565c _ uiapplicationhandleevent + 4088
6 graphicsservices 0x00009b0b4 purpleeventcallback + 428
7 graphicsservices 0x00009d818 heartbeatvblcallback + 152
8 iomobileframebuffer 0x31f3e8f8 iomobileframebufferpolicyfunc + 124
9 com. Apple. Framework. iokit 0x30f342b8 iodispatchcalloutfromcfmessage + 304
10 corefoundation 0x3025ced4 _ cfmachportperform + 72
11 corefoundation 0x3025bed6 cfrunlooprunspecific + 2364
12 corefoundation 0x3025b584 cfrunloopruninmode + 44
13 graphicsservices 0x0000998e4 gseventrunmodal + 268
14 uikit 0x30a5e308-[uiapplication _ run] + 404
15 uikit 0x30a671dc uiapplicationmain + 1064
16 cancelines 0x00002090 main (main. M: 16)
17 cancelines 0x0000202c start + 44


First, check the crash thread in the crash log, for example:

Thread 0 crashed:
0 libobjc. A. dylib 0x00003ec0 objc_msgsend + 24
1 MyApp 0x000036d2 0 × 1000 + 9938

We get the memory address for user crash: 0x000036d2

Return to the build directory of our application. The directory must contain two files: MyApp. app and MyApp. App. dsym.

Use the dwarfdump command on the console to parse the memory address, for example:

Dwarfdump-lookup 0x000036d2-arch armv6 MyApp. App. dsym

The output information is as follows:

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.