Android的稳定性

概述

Android的稳定性包含以下几个方面:
1.ANR
2.Crash
3.Tombstone
4.Freeze
5.黑屏
6.冻屏

#稳定性问题分析以及需要的相关log
/data/anr/traces.txt
/data/system/dropbox
/data/tombstones

Android系统各种稳定性问题所需要的log
Android系统各种稳定性问题所需要的log
adb shell bugreport > bugreport.txt
adb shell dumpstate > dumpstate.log (this command will produce trace log about all process then u need adb pull /data/anr to collect the trace log)
adb shell dumpsys > dumpsys.log

adb pull /data/tombstones (All log file time must be consistent with issue occurred time, it needs to clear /data/anr &; /data/tombstones after stability issue occu)

System Freeze/ Touch panel freeze系统卡死/屏幕卡死

adb shell getevent 此命令可以获取实时触屏以及按键事件log
adb shell getevent -rtl /dev/input/event0 按键事件

open echo w > /proc/sysrq-trigger when capture dmesg and bugreport log as follows:
adb root
adb remount
adb shell
echo w > /proc/sysrq-trigger
&; then exit adb shell, then collect bugreport
adb shell bugreport > bugreport.txt
adb shell kmesg > kmesg.txt 没有kmesg
/proc/sysrq-trigger文件的强大功能
Linux内核调试方法总结之sysrq
/proc/sysrq-trigger详解

adb pull /d/binder/ . 所有的binder信息

adb shell dumpsys window > dump_window.txt

adb shell cat proc/meminfo > meminfo.txt

adb shell procrank > procrank.txt

adb shell top > top.txt

##检查adb,TP,显卡驱动,按键是否正常工作
•Adb workable or not, ANR or not
•CTP workable or not ->
touch screen and observe
the output of “adb shell getevent”.
•Display driver workable or not ->
Use the screencast to see
if the screen can be displayed
•Power key/volume key work or not?
Menu/back/home key work or not?

##触发一次Dump,不同平台方式不一样
It’s better to trigger a ram dump
Before test:
adb root
adb shell “echo 0x843 > /d/spmi/spmi-0/address”
adb shell “echo 0x80 > /d/spmi/spmi-0/data”
Then long press power key more than 10~30s
could trigger a dump.
If device is rebooted, it needs to set again.

Black screen 黑屏

Android系统(110)—稳定性问题总结

ANR

思路: 机制 –> 触发原因 –> 如何避免 –> 如何分析和解决问题
Android稳定性专题之ANR

Crash

Android稳定性专题之CRASH
Android系统稳定性—-Crash

Watchdog

机制/原理 –> 实现方式

系统进程的Watchdog
Android Watchdog框架看门狗解析、死锁应用与改造(上)
Android Watchdog框架看门狗解析、死锁应用与改造(下)
Watchdog机制以及问题分析
Watchdog机制以及问题分析
Android Watchdog机制介绍与分析

Tombstone

Panic

OOM

稳定性测试

Android稳定性测试工具Monkey的使用
Android稳定性测试– Monkey二次开发

参考文献

安卓App稳定性之旅

Android 系统稳定性 - OOM(二)