IOS development diary 35-Xcode7 debugging magic, ios35-xcode7
Today, the blogger has a need to upgrade Xcode7 and encountered some difficulties. I would like to share with you the hope to make common progress.
1. Address Sanitizer: no longer need to worry about EXC_BAD_ACCESS
EXC_BAD_ACCESS has always been a nightmare for many developers, because this error is not intuitive and often takes a long time to locate the error. Apple has brought about revolutionary improvements this time.
Under Diagnostics in the Scheme of the project, select enable address sanitizer (note that Xcode will recompile the entire project after selection ).
After this setting, if a similar error occurs again, a more detailed error message will be prompted, and even the memory usage will be displayed.
2. crash tracking after release to easily locate the crash code
After iOS9 is upgraded, Apple will ask the user if they agree to collect the application crash report. In this way, you can see some collected data in the background statistics of itunes connect (a considerable number of users usually disagree, so only part of the data ).
2.1 view crash statistics
Select app Analysis in the connect background
On the Analysis page, select "metrics" in the tab"
Select "crash" in the menu on the left"
In this way, we can see the crash statistics collected by Apple,Be sure to note that this is only part of the dataFor example, if you see 10 crashes, but Apple may only collect 20% of user information. So you can probably estimate that it should be 10*5 = 50 crashes.
2.2 view the specific crash information in Xcode
Select organizer under the window in the xcode menu, and select Crashes in the window that opens, in this way, Xcode starts to download the relevant crash information to the local machine (it may take some time if the network environment is poor ).
Organizer window
You can select the release version on the left to view the crash information.
In the crash information column, Apple sorts the number of crashes by the maximum number of crashes. The detailed information on the right shows the call stack when the crash occurs. You can see which line of code causes the crash.
After selecting the crash to be resolved, you can select open in project on the right side of the window.
Something amazing happened !!!In the open project, the line of code that crashed will be located directly. This greatly improves the debugging efficiency! I can't wait to share this joy with my colleagues who developed android.
Note! Note!
Because xcode7 is not used for packaging during the previous project releaseGuessThe symbol table may not be uploaded to the Apple Server. Therefore, the previous project may not directly display the line of code, but the memory address with an error during the call. However, you can see it in the next version after using xcode.
After resolving this crash, you can mark it as resolved. There are two places to mark.
So if you haven't upgraded xcode7, hurry up. O (distinct _ distinct) O ~