Android应用被杀的日志分析记录

站长公众号

前言

最近Android项目中出现一个问题,应用开机源记忆拉起,突然被强制性退了(看Activity的生命周期),搞得我一时懵逼了。

日志有这几个打印

BufferQueueConsumer(  419): [Splash Screen com.la.media#0](this:0x7ccbe90000,id:4,api:2,p:-1,c:419) getReleasedBuffers: returning mask 0xffffffffffffffff
SurfaceFlinger(  419): Attempting to set client state on removed layer: Splash Screen com.la.media#0
SurfaceFlinger(  419): Attempting to destroy on removed layer: Splash Screen com.la.media#0
BufferQueueConsumer(  419): [Splash Screen com.la.media#0](this:0x7ccbe90000,id:4,api:2,p:-1,c:-1) disconnect(C)

最后查到原来SystemUI中做了开机3s后移除当前任务栏中的app清除功能:

mIActivityManager.removeTask(mRecentTaskInfo.persistentId);

当然,这里是本来是有包名判断的,但由于我的包名更改了。

在网上看到有一篇关于APP被杀的日志分析整理,有点多,因此我整(摘)理(抄)于此,方便自己查阅。

好记性不如烂笔头

总结

大部分是都可以看这几个关键字libprocessgroup、kill、Force stopping和System.exit就可以解决问题。

当我的都没有这些提示,仅仅提示:

SurfaceFlinger(  419): Attempting to destroy on removed layer: Splash Screen

当然具体问题具体分析。

正文

本文部分内容摘抄,只摘抄了部分,其他的感觉很常见,什么异常退出,OOM退出等。

Android Studio 运行app强制 stop app

其实就是运行一个真正运行的程序,安装前AS会强制性停止这个程序

ActivityManager(  628): Force stopping com.la.media appid=1000 user=0: from pid 10320
BufferQueueProducer(  419): [com.la.media/com.la.media.MusicActivity#0](this:0x7ccbf23000,id:13,api:1,p:10039,c:419) disconnect(P): api 1
BufferQueueConsumer(  419): [com.la.media/com.la.media.MusicActivity#0](this:0x7ccbf23000,id:13,api:1,p:-1,c:419) getReleasedBuffers: returning mask 0xffffffffffffffff
ActivityManager(  628): Process com.la.media (pid 10039) has died: pers PERU
libprocessgroup(  628): kill(-10039, 9) failed: No such process
libprocessgroup(  628): Successfully killed process cgroup uid 1000 pid 10039 in 0ms
ActivityManager(  628): Re-adding persistent process ProcessRecord{d1bf08b 10039:com.la.media/1000}
InputDispatcher(  628): Attempted to unregister already unregistered input channel '8761742 com.la.media/com.la.media.MusicActivity (server)'
ActivityManager(  628): Force removing ActivityRecord{9ed0aa9 u0 com.la.media/.MusicActivity t16}: app died, no saved state

注意下这些关键字:

Force stopping
libprocessgroup
kill

adb shell kill pid

这个是通过adb shell kill pid达到的效果

ADB_SERVICES(15460): service_to_fd shell,v2,raw:kill 15602
libprocessgroup(  628): kill(-15602, 9) failed: No such process
libprocessgroup(  628): Successfully killed process cgroup uid 1000 pid 15602 in 0ms
ActivityManager(  628): Process com.la.media (pid 15602) has died: pers PERU
ActivityManager(  628): Re-adding persistent process ProcessRecord{d1bf08b 15602:com.la.media/1000}
ActivityManager(  628): Force removing ActivityRecord{98365ce u0 com.la.media/.MusicActivity t18}: app died, no saved state

关键字:

ADB_SERVICES
kill
libprocessgroup
died

APP system.exit

nix.testprojec: System.exit called, status: 0
AndroidRuntime: VM exiting with result code 0, cleanup skipped.
ActivityManager: Process com.lunix.testproject (pid 5690) has died: fore TOP 
WindowManager: WIN DEATH: Window{70a5bc0 u0 com.lunix.testproject/com.lunix.testproject.MainActivity}
InputDispatcher: Attempted to unregister already unregistered input channel '70a5bc0 com.lunix.testproject/com.lunix.testproject.MainActivity (server)'
Zygote: Process 5690 exited cleanly (0)
libprocessgroup: kill(-5690, 9) failed: No such process
libprocessgroup: Successfully killed process cgroup uid 10050 pid 5690 in 0ms
ActivityManager: Force removing ActivityRecord{afc7fb6 u0 com.lunix.testproject/.MainActivity t55}: app died, no saved state
SurfaceFlinger: Attempting to destroy on removed layer: AppWindowToken{76bf424 token=Token{93004b7 ActivityRecord{afc7fb6 u0 com.lunix.testproject/.MainActivity t55}}}#0

关键字

System.exit
libprocessgroup
kill

参考文章

  1. [Note] 2021-06-22应用被杀的日志分析

站长公众号
版权声明:125la.com站长 发表于 2021年6月29日 下午12:12 。
转载请注明: Android应用被杀的日志分析记录 | 125啦读书导航

相关文章

站长公众号

暂无评论

暂无评论...