iOS development: Some of the debugging techniques in Xcode7

Source: Internet
Author: User
Tags memory usage

Apple has added two important debug-related features to our Xcode7. After the understanding feel very practical, introduced to everyone.

1.Address sanitizer: Mom doesn't have to worry about exc_bad_access anymore?

Exc_bad_access has been a nightmare for many developers because the error is so intuitive that it often takes a long time to locate the error. Apple has brought a revolutionary boost this time.

In Project scheme diagnostics, select the Enable address sanitizer (note that Xcode will recompile the entire project when selected).

After this setting, if a similar error occurs, there will be more detailed error messages and even a memory usage display.

2. After the release of the crash tracking, easy to locate the crash code

After upgrading the iOS9, Apple asks the user if they agree to collect the application crash report. This allows you to see some of the data that is collected in the background statistics of itunes Connect (usually a considerable number of users disagree, so only part of the data).

2.1 View crash statistics

Select app Analysis in connect background

After entering the analysis page, select Indicators in the tab

Then choose Crash from the menu on the left

So you can see the crash statistics that Apple collects, and be sure to note that this is just part of the data, for example if you see a crash of 10 times, but maybe Apple only collects 20% of the user's information. So you can probably estimate that it should be a 10*5=50 crash.

2.2 View specific crash information in Xcode

Select Organizer under the window of the Xcode menu and select crashes in the open windows so that Xcode will start downloading the relevant crash information locally (you may have to wait some time for a bad network environment).

Organizer window

You can select the release version on the left that you want to view crash information

In the crash Information section, apples are sorted according to the number of crashes, and the number of crashes is the highest. The detailed information on the right shows the call stack at the time of the crash, and you can see which line of code is causing the crash.

After you select the crash you want to resolve, you can select Open in Project on the right side of the window.

Something magical happened!!! In an open project, you navigate directly to the line of code that crashed. This greatly improves the efficiency of debugging! I have been so impatient to share this joy with my fellow developers of Android.

Pay attention!

Since the previous project was not packaged with Xcode7, the guessing symbol table might not be uploaded to the Apple server, so the previous project might not be able to show the line of code directly, but instead display the memory address that went wrong at the time of the call. However, the next version you use Xcode released after you can see the normal.

After this crash is resolved, it can be marked as resolved. There are two places to mark.

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.