Xcode7.3 Tool parsing app crash log (. crash file)

Source: Internet
Author: User

Xcode7.3 Tool parsing app crash log (. crash file)

Original link: http://blog.csdn.net/u011056605

After the app or game has been submitted for review, you will occasionally receive feedback from the test, saying that the application crashed and the bug appeared occasionally, and it was difficult to find a definite way to reproduce it.

What to do? Crash files can be analyzed, that is, after the app crashes, automatically protect the device's local. Crash file.

The way to get the crash log is described in getting debug information on the device and crash log analysis.

In the case of an environment OK, Xcode can automatically parse the. crash file. Older versions of Xcode can even import third-party. crash files, but xcode7.3 seems to be unable to import the. crash file.

The old version is opened in the menu Window-organizer, directly below the interface can be imported. crash file,

The new version of the interface has been modified and seems unable to import directly. crash files,

At this point, we still use Xcode's Symbolicatecrash tool to parse the. crash file from the test.

1. Configure the environment variable Developer_dir, if configured, skip this step

Temporary method: Open terminal terminal, enter command

[Plain]View Plain Copy  
    1. Export Developer_dir=/applications/xcode.app/contents/developer

Permanent method: Edit ~/.bash_profile, add at the end

[Plain]View Plain Copy  
    1. # ADD environment variable Developer_dir
    2. Export Developer_dir=/applications/xcode.app/contents/developer
    3. Export path= $DEVELOPER _dir: $PATH

Then save the file, use the source ~/.bash_profile command, or completely exit the terminal to refresh the environment variable.

2. Find the resolution tool Symbolicatecrash for Xcode. Query the path of the tool, it seems that many blogs are old version of Xcode, so according to the content of the blog is difficult to find tools.

The Symbolicatecrash tool path I used for the Xcode 7.3 version is

[Plain]View Plain Copy  
    1. /applications/xcode.app/contents/sharedframeworks/dvtfoundation.framework/versions/a/resources/ Symbolicatecrash
Other versions of the small partners can look at the following directories, or search by themselves [Plain]View Plain Copy  
    1. /applications/xcode.app/contents/sharedframeworks/dtdevicekit.framework/versions/a/resources
[Plain]View Plain Copy  
    1. /applications/xcode.app/contents/sharedframeworks/dtdevicekitbase.framework/versions/a/resources
[Plain]View Plain Copy  
    1. /applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/library/privateframeworks/ Dtdevicekit.framework/versions/a/resources

When I found it, I copied it directly to the desktop.




3. Install Xcode command line tools tool to view this log in Xcode command line tools installation method

Step or open the terminal, enter the following command to start the download installation

[Plain]View Plain Copy  
    1. Xcode-select--install

4. Locate the. dsym file for the app package, emphasizing the corresponding

. DSYM is a transit file that holds the address mapping information for 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. Test given to the. crash file, the exact statement and function portion of the crash are only 16 binary address symbols, not the xxx.cpp (xxfunction xx line) We see in Xcode debugging. Such as

We need to use the. dsym file to parse the address so that we can see which of the classes is in question. How to get the. dsym file, debug information on the Get device and crash log analysis has to say.

If this is a local real-machine test, the path should be

/users/name/library/developer/xcode/deriveddata/myapp-aerllxbslxqnjhgfeoiagutyemyz (A string of strange values)/Build/Products

The Debug-iphoneos and Release-iphoneos folders in the directory will contain the. App and. dsym files

In the case of publish mode, you can see the published app version in the Xcode menu Window-organizer box and select the corresponding version to download the. dsym file, as

Under normal circumstances this is available to the. dsym file, if not, there is no way to parse the. crash file. Remember to look at your project configuration:

5. After you have obtained the. crash file. dsym file Symbolicatecrash tool, you can begin parsing the crash log.

To parse the. Crash file, you need the. dsym file that corresponds to its version, which is the corresponding UUID.

Use the following command to view the UUID of the. dsym file

[Plain]View Plain Copy  
    1. Dwarfdump--uuid/users/qufangliu/mydsym.app.dsym
Effect

can open a. crash file and view the UUID for the dSYM file that the crash file requires, such as

6. As you can see, we already have the corresponding. Crash and. dsym files. You can start parsing directly.

The parse command format is: Symbolicatecrash parsing tool. crash file. dsym file > Output to a file (custom). Results

7. You can view the results file

As you can see, the original address symbol is parsed out and we can see directly the function and file that caused the crash. This makes it easy to check for bugs.

Use the Symbolicatecrash tool to resolve crash log conditions:

1. Configure the environment variable DEVELOPER_DIR.

2. Find the parse tool for Xcode Symbolicatecrash

3. The command line tools tool with Xcode installed

4. Obtaining the. Crash file

5. Obtaining the. dsym file

The UUID of the 6..crash file and the. dSYM file should correspond (it is said that each package will appear differently. DSYM)

Attention:

In the debug mode of the project, the default is not to generate the. dsym file. If it is not found, check the project Settings Build setting->build option entry.

Questions:

After local real-machine debugging is packaged. Directory

/users/qufangliu/library/developer/xcode/deriveddata/tinycoloroad-fovkdduxiolajbggnwdfrfgqhoaw/build/products

The following folder is generated

In the example above, the UUID of the. dsym file under the Debug-iphoneos folder corresponds to the UUID of my. Crash file. The UUID of the. dsym file under the Release-iphoneos folder differs from the UUID of the. Crash file that I obtained, but can also parse my. Crash file normally. haha haha haha

Xcode7.3 Tool parsing app crash log (. crash file)

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.