• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

ios - 如果您的应用程序被 iOS 系统终止,它会生成崩溃报告吗?

[复制链接]
菜鸟教程小白 发表于 2022-12-12 14:47:12 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

在设备上运行时(iOS 8),我认为系统可能会在我的应用程序暂停时终止我的应用程序,因为内存或后台任务运行时间过长。我怀疑这是因为当我恢复应用程序时它已经返回到 Root View Controller ,除非应用程序重新启动,否则这是不可能的。

但是,在查看设备日志时,我从未看到它的崩溃报告。

如果系统终止您的应用程序,它会始终生成崩溃报告吗?



Best Answer-推荐答案


如果应用程序被低内存杀死通常 generates a low memory report:

When a low-memory condition is detected, the virtual memory system in iOS relies on the cooperation of applications to release memory. Low-memory notifications are sent to all running applications and processes as a request to free up memory, hoping to reduce the amount of memory in use. If memory pressure still exists, the system may terminate background processes to ease memory pressure. If enough memory can be freed up, your application will continue to run and no crash report will be generated. If not, your application will be terminated by iOS because there isn't enough memory to satisfy the application's demands, and a low memory report will be generated and stored on the device.

The format of a low memory report differs from other crash reports in that there are no stack traces for the application threads. Memory usage of each process is reported in terms of number of memory pages, which as of this writing are 4KB each. You will see "(jettisoned)" next to the name of any process terminated by iOS to free up memory. If you see it next to your application's name, that confirms the application was terminated for using too much memory.

这个报告通常可以在崩溃日志中看到,但根据我的经验,这个日志并不能保证。

An example of a memory report:

Incident Identifier: 30E46451-53FD-4965-896A-457FC11AD05F
CrashReporter Key:   5a56599d836c4f867f6eec76afee451bf9ae5f31
OS Version:          iPhone OS 3.1.3 (7E18)
Date/Time:           2012-10-17 21:39:06.967 -0400

Free pages:        96
Wired pages:       10558
Purgeable pages:   0
Largest process:   Rage Masters

Processes
     Name                 UUID                    Count resident pages
Rage Masters <cc527ca9b51937c5adbe035fe27a7b12>    9320 (jettisoned) (active)
mediaserverd <3d3800d6acfff050e4d0ed91cbe2467e>     255
 dataaccessd <13d80b2e707acc91f9aa3ec4c715b9cc>     505
     syslogd <8eddddc00294d5615afded36ee3f1b62>      71
        apsd <32070d91b216d806973c8f1b1d8077a4>     171
   securityd <b9e51062610d27f727c5119b8f80dcdf>     243
     notifyd <591dd4dd804b4b8741f52335ea1fa4ab>    2027
  CommCenter <b4b87526ae086bb62c982f1078f43f81>     189
 SpringBoard <324939a437d1cca1fa4af72d9f5d0eba>    2158 (active)
  accessoryd <8f21c8b376d16e2ccb95ed6d21d8317a>      91
     configd <85efd41aceac34ccc0019df76623c7a9>     371
   fairplayd <a2eaf736b3e07c7c9a2c82e9eb893555>      93
mDNSResponder <df1cd275e4ad434e0575990e8e1da4cb>     292
   lockdownd <80d2bd44c0bcca273d48ce52010f7e65>    1204
     launchd <a5988245aade809bf77576f1d9de42c5>      72

其实这是 crashlytics 团队的问题之一 trying to solve :

These are tricky, as these events are actually separate events from crashes. Low-memory events are complex to capture as there is no known way to capture a low-memory exit with public API.

However, we are working on a system that will produce a record of these events. Stay tuned!

关于后台崩溃,通常你会得到一个类似 this message: 的崩溃日志。

Application Specific Information:
MyMapApp[1234] has active assertions beyond permitted time: 
{(
    <SBProcessAssertion: 0x63a07a0> identifier: CoreLocationRegistration process: MyMapApp[1234] permittedBackgroundDuration: 600.000000 reason: finishTask owner pid:1234 preventSuspend  preventIdleSleep ,
<SBProcessAssertion: 0xa095050> identifier: CoreLocationBackgroundClient process: MyMapApp[1234] permittedBackgroundDuration: 600.000000 reason: finishTask owner pid:1234 preventSuspend  preventIdleSleep 
)}

关于ios - 如果您的应用程序被 iOS 系统终止,它会生成崩溃报告吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29176900/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap