聊聊移动产品稳定性

来源:互联网 发布:单片机引脚功能 编辑:程序博客网 时间:2024/05/05 16:03

移动产品:web app,native app,hybrid app

对于native app,最大的优势是原生体验,最大的劣势是糟糕发布节奏。
完整的native app,发布节奏繁文缛节,用RD熟悉的发言表达了下:

Created with Raphaël 2.1.2产品上线是否检查到crash?解决crash重新上线重新发布用户下载yesno

这个工程很漫长,即使开发者发布新的版本,用户早已经卸载产品。好痛苦啊,这个对于公司来说,简直就是灾难。因此,稳定性已经成为各个公司衡量产品质量和性能的重要目标。

为了完成该目标,为产品上线后保驾护航,工程师们建立一套完成的技术体系解决方案。

  • 本地crash系统保护
  • 线上crash收集
  • 服务crash解析
  • crash数据分析
  • 云端调试分析
  • 云端crash修复

本地crash系统保护

在终端的开发过程中,由于RD的水平层次不齐,到时会出现一些比较低级的crash。这部分感谢邢总教育和指导。
对于iOS来说比如:

NSMutableArray* list = [NSMutableArray new];[list addObject:nil];NSMutableDictionary* map = [NSMutableDictionary new];[map setObject:nil forKey:@"haha"];...id obj = map;[map function];

这些问题都可以通过本地crash保护解决。

线上crash收集

这个问题可以通过开源的plcrashreport解决,或者通过百度的mtj,腾讯的bugly等这些第三方分析库解决

云端crash修复

这个问题可以通过基于wax的waxpatch和基于javascript core的jpatch解决。

注意: waxpatch存在不支持64位和纯lua的类无法释放,这两个问题,jpatch目前还存在一些bug,这些问题需要开发者自己解决后,才集成到工程中,解决方案后续在说明。


以上每个部分,我都是提了概念,在具体实践中,遇到了很多坑,对于每个坑都需要开发者自己慢慢去填补。每个环节,都有很多要做的地方,不断保证该技术体系不断完备。

移动产品的稳定性,永远都是每个产品的核心。
后续的博客中,我会不断把自己遇到的问题进行详细的说明,希望和大家一起讨论。


Crash蛛丝马迹

对于收集上来的crash,exception code往往会标识出来部分的crash原因。下面是我有空时收集上来的,还有些平时懒就没有记录下,以后我会不断记录这些

SIGSEGV是权限的问题,地址是有效的,但是对于该地址无权访问
根据实验,一般都是地址越界了。
还有一种情况,指针对应的地址是无效地址,没有物理内存对应该地址,访问不该访问的地址

SIGBUS 内存对齐问题
内存对齐问题,检查是否有不适当的强制类型转换。
具体例子如下:

char buf[64];int *p;p = (int*)buf[1];*p = 1;

The exception code 0xbaaaaaad 系统崩溃了
indicates that the log is a stackshot of the entire system, not a crash report. To take a stackshot, push the home button and any volume button. Often these logs are accidentally created by users, and do not indicate an error.

The exception code 0xbad22222 VoIP频繁断了连,连了断,系统Kill App
indicates that a VoIP application has been terminated by iOS because it resumed too frequently.

The exception code 0x8badf00d app卡死,系统看门狗杀死app
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.

The exception code 0xc00010ff 手机设备热量事件
indicates the app was killed by the operating system in response to a thermal event. This may be due to an issue with the particular device that this crash occurred on, or the environment it was operated in. For tips on making your app run more efficiently, see iOS Performance and Power Optimization with Instruments WWDC session.

The exception code 0xdead10cc 调用系统资源
indicates that an application has been terminated by iOS because it held on to a system resource (like the address book database) while running in the background.

The exception code 0xdeadfa11 被用户kill
indicated that an application has been force quit by the user. Force quits occur when the user first holds down the On/Off button until “slide to power off” appears, then holds down the Home button. It’s reasonable to assume that the user has done this because the application has become unresponsive, but it’s not guaranteed - force quit will work on any application.


【叁省 http://blog.csdn.net/bjtufang 转载烦请注明出处,尊重劳动成果】

0 0