ANR = Application Not Responding
Not response to an input event(eg: key press,screen touch) within (15 seconds or 8 seconds,default 5 seconds)
a broadcastReceiver hasn’t finished within 10 seconds
Request service failed within 20 seconds
Java process has main thread and main message queue(main thread = activity thread)
The Main Thread ,that is responsible for handling the ui events like Draw,Listen and receive the UI events.
Main thread will pick up message from main message queue and dispatch it as soon as possible.
Before main thread finish processing current message ,it can not pick up next one.
If main thread stuck with one message and fail to dispatch is in time, ANR will occur.
We need to know why main thread can not process the message in time?
So need the follow files for analyze.
Aee_exp->db files(data/aee_exp)
MoblieLog->APLog_xxx_xxx->APLog
MdLog->MDLog_xxx_xxx->Modem Log
Netlog-> MDLog_xxx_xxx->Network Log
Trace.txt
Mobile Log:
you can get more info about anr from event log and main log:
LOG中搜索关键字:
anr
application is not responding
system_app_anr
Trace.txt
you can get callstack from the Trace.txt
在APLOG中搜索关键字:
anr
application is not responding
IDLE界面进入图库,打开大量的图片,选择条目,点击几张图片,按HOME键,再从IDLE界面进入图库,点击图片,弹出图库没有响应。
(1)find anr time,process ID,ANT type
在APLOG中搜索关键字:
anr
application is not responding
system_app_anr
(2)Check CPU usage
(3)check Trace.txt,mapping process id and time stamp.
最后发现是在主线程中执行了耗时操作query数据库,导致ANR
(4)find more info from main and event log to check main thread.
最后确认是:
main thread are busy query db database all the time.
提供有效的LOG:
-MTKLog saved in T card,include:
Aee_exp->db files
MoblieLog->APLog_xxx_xxx->APLog
MdLog->MDLog_xxx_xxx->Modem Log
Netlog-> MDLog_xxx_xxx->Network Log
-data/anr saved on the phone,include:
Trace.txt
最好是提供ENG的LOG,ENG会提供了更多的信息。
1.如何分析解决Android ANR
http://blog.csdn.net/dadoneo/article/details/8270107
2.Android ANR分析与总结
http://blog.csdn.net/androiddevelop/article/details/49515903
3.Android ANR分析
http://blog.csdn.net/yxz329130952/article/details/50087731
4.Application Not Responding(ANR) Analyze
MediaTek On-Line > eCourse Home > SW > ALPS > Common Framework