Common face questions for iOS

Source: Internet
Author: User

1. How to track app crash rate, how to resolve online flash back

When apps on an iOS device flash back, the operating system generates a crash log that is on the device. There is a lot of useful information on the crash log, such as the full stack trace and memory image of each executing thread, to find out why the app is being flashed by parsing the information and then locating the code logic at the time the crash occurred. Typically, crash comes from two types of problems: crash that violate the crash and app code logic bugs caused by iOS system rules, and analyze them separately.

There are three types of crash that violate iOS system rules:

(1) Memory alarm flash Back

When iOS detects that memory is too low, its VM system emits a low memory warning notification, attempts to reclaim some memory, and if the situation is not improved enough, iOS terminates the background app to reclaim more memory, and finally, if the memory is insufficient, the running app may be terminated. In debug mode, you can actively write the client's action logic into a log file, so that the program child shoes can write the logic of memory warning to the log file, when the following memory alarm occurs, is to remind the current client performance memory is tight, Memory allocation issues and memory leak issues can be identified through the allocations and leaks library in the instruments tool.

(2) Response timeout

When an application is not responding to specific events (such as Start, suspend, resume, end), Apple's watchdog mechanism kills the application and generates a corresponding crash log. These events correspond to the following uiapplicationdelegate methods, and when you encounter the watchdog log, you can check that there are several ways in which the action of a heavier blocking UI is in order.

123456 application:didFinishLaunchingWithOptions:applicationWillResignActive:applicationDidEnterBackground:applicationWillEnterForeground:applicationDidBecomeActive:applicationWillTerminate:

(3) User forced to quit

Once you see "User forced Exit", you might first think of double-clicking the Home key and then closing the application. However, this scenario generally does not produce a crash log, because when you double-click the Home key, all applications are in the background state, and iOS can turn off the background process at any time, and this scenario generates crash logs when the blocking interface is applied and stops responding. This refers to the "user forced exit" scenario, which is a slightly more complex operation: Press and hold the Power key until the "swipe off" interface appears, then press and hold the home button, and the current application is terminated and a crash log of the corresponding event is generated.

Bugs that apply logic

Most flash crash logs are generated due to bugs in the app, which have many errors, such as:

    • SEGV: (segmentation violation, Segment violation), invalid memory address, such as null pointer, uninitialized pointer, stack overflow, etc.;

    • SIGABRT: Receive abort signal, may call abort () or receive external signal sent over;

    • Sigbus: Bus error. Unlike SIGSEGV, SIGSEGV accesses an invalid address (such as a virtual memory mapping is not physical), and Sigbus accesses a valid address, but bus access exceptions (such as address alignment issues);

    • Sigill: Attempt to execute an illegal instruction that may not be recognized or has no authority;

    • Sigfpe:floating point Error, mathematical calculation related problems (may not be limited to floating points calculation), such as except 0 operations;

    • Sigpipe: No process at the other end of the pipeline takes over data;

Common face questions for iOS

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.