iOS watch dog 机制

为了防止一个应用占用过多系统资源,苹果设计了一个“看门狗”watchdog 机制。

如果超出了该场景规定的运行时间,“看门狗”就会强制kill掉这个应用,在crashlog 会看到 “0x8badf00d”的错误代码~

如果我们的应用程序对一些特定的UI事件(比如启动、挂起、恢复、结束)响应不及时,watchdog会把我们的应用程序干掉,并生成一份crash报告。

https://developer.apple.com/library/archive/technotes/tn2151/_index.html

The exception code 0x8badf00d indicates that an application has been terminated by iOS because a watchdog timeout occurred. The application took too long to launch, terminate, or respond to system events. One common cause of this is doing synchronous networking on the main thread. Whatever operation is on Thread 0 needs to be moved to a background thread, or processed differently, so that it does not block the main thread.

你可能感兴趣的:(iOS watch dog 机制)