IOS crash uploads

Source: Internet
Author: User

Theme:

This article is intended to explore the code for quickly finding a corresponding bug based on upload log when iOS encounters crash.

Body:

1. dSYM file

(1) What is a DSYM file?

DSYM is a transit file that holds the address mapping information for the 16 binary functions, and the symbols we debug is included in this file, and a new DSYM file is generated each time the project is compiled.

(2) What is the role of the DSYM file?

When our software release mode is packaged or on-line, it will not be as intuitive as we do in Xcode to see the crash error. The IOS device will have a log file to save each of our application error function memory address, this time we can use the wrong function address to query the DSYM file of the corresponding functions of the program name and file name . The premise is that we need to have a software version corresponding to the DSYM file, which is why it is necessary for us to save each release version of the Archives file.

(3) dSYM file View:

First, do not use the simulator but choose generic IOS Device (do not plug in the real machine), click xcode-product-archive to archive;

Then, you can see the corresponding archive entry under Xcode-window-organizer ;

right--show in finder , you see the corresponding . xcarchive file in the Finder (that is, the archive file is in the directory ~/library/developer/xcode/ Archives ). Right-click on the. xcarchive file and you will see a. app.dsym file and a . App file in the Procucts directory.

What is contained in the. xcarchive file

(4) How to check the. Crash in the app file

Each Xx.app and Xx.app.dSYM file has a corresponding Uuid,crash file with its own UUID, so long as the three files have the same UUID, we can parse out the correct error function information through them.

To view the UUID of the Xx.app.dSYM file, enter the command in terminal:

To solve the problem:

1. How are crash log and dSYM files obtained? (How to pack)

2. How do I get error messages based on crash log and dSYM files?

3. How to apply to the online?

4. Friends of the League reference.

Verify:

1. Can I export devicelog from an IOS device to a crash file via Xcode's organizer?

2. Do you know how to obtain the following information about the program?

DSYM uuid:365ef56e-d598-3b94-ad36-bfa13772a4e3
CPU type:armv7s
Slide address:0x00001000
Binary Image:appname
Base address:0x000c3000

3. An example

Log information:

5 appname 0x97525 appname + 615717
It points out the name of the application, the address of the calling method at the time of the crash, the address of the file, and the location of the line where the method is located, followed by the symbolic (symbolication) sentence, using Dwarfdump to detect the crash log dSYM Whether the UUID and local dsym files match.

Open Terminal:

 cd/users/username/library/developer/xcode/archives/2013 -08 -30 /app 8 -30 -13  6.19  Pm.xcarchive/dsyms dwarfdump --uuid Appname.app.dSYM uuid:9f0aefa6 -4349  -30af-8420 -bcee739da0b4 (armv7) appname.app.dsym/contents/ Resources/dwarf/appname uuid:365ef56e -d598-3b94-ad36-bfa13772a4e3 (armv7s) Appname.app.dsym/contents/resources/dwarf/appname 

The dSYM uuid in the Ok,crash log matches the local Dysm file. Okay, let's find out next . 0x 97525 What's this address?

0x97525  /users/username/library/developer/xcode/archives/-8-30 -6.19\ Pm.xcarchive/dsyms/appname.app.dsym/contents/resources/dwarf/appname  

The results obtained:

----------------------------------------------------------------------File:/users/username/library/developer/xcode/archives/ -- ,- -/appname8- -- - 6.19pm.xcarchive/dsyms/appname.app.dsym/contents/resources/dwarf/appname (ARMV7)----------------------------------------------------------------------looking up Address:0x0000000000097525 inch. Debug_info ... found!0x00359c67: Compile unit:length =0x000066f1Version =0x0002Abbr_offset =0x00000000Addr_size =0x04(Next CU at0x0036035c)    0x00359c72: Tag_compile_unit [1] *At_producer ("Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2SVN)") at_language (DW_LANG_OBJC) at_name ("xxx/egoimageview.m") at_low_pc (0x0009710c) At_stmt_list (0X000655C1) At_comp_dir ("XXX") at_apple_optimized (0x01) At_apple_major_runtime_vers (0x02 )    0x00359e57: Tag_subprogram [Ten] *At_name ("-[egoimageview imageloaderdidfailtoload:]") At_decl_file ("xxx/egoimageview.m") At_decl_line ( the) at_prototyped (0x01) At_apple_isa (0x01) at_low_pc (0x00097490) at_high_pc (0x00097572) at_frame_base (R7) at_object_pointer ({0x00359e6e}) Line tabledir:'XXX'Line Tablefile:'egoimageview.m'Line About, column2With start address0x00000000000974felooking up Address:0x0000000000097525 inch. Debug_frame ... found!0x0000c620: FDE Length:0x0000000cCie_pointer:0x00000000start_addr:0x00097490-[Egoimageview imageloaderdidfailtoload:] range_size:0x000000e2(end_addr =0x00097572) Instructions:0x00097490: cfa=4294967295+4294967295  

Three steps:

1. Collect crash log;

2. dsmy file generation;

3. Use crash log and Dsmy file to symbolize.

Collect crash log:

Thought: The crash log information is stored locally, the next time you start the app, check if there is stored crash information, upload to the server.

( note thatwhen Crash is manufactured , do not use Xcode debugging , Xcode prevents crash from being stored locally.) )

IOS crash uploads

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.