V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
272664150
V2EX  ›  Android

Android 手机如何监听 ANR,并获取 log?

  •  
  •   272664150 · Dec 21, 2017 · 16494 views
    This topic created in 3058 days ago, the information mentioned may be changed or developed.

    已知在没 root 的情况下,FileObserver 没权限监听。通过不断向 UI 线程 post 消息的方式,对广播和 service 无效。

    6 replies    2017-12-26 17:37:52 +08:00
    thinkloki
        1
    thinkloki  
       Dec 21, 2017
    关键字:android.intent.action.ANR ,系统 ANR 会有这个广播发出来,然后就是 /data/anr/traces.txt 文件了。
    celltree
        2
    celltree  
       Dec 21, 2017
    直接安装 u 盟的日志 SDK,各种日志和统计都可以在线查看了
    272664150
        3
    272664150  
    OP
       Dec 21, 2017
    @thinkloki 我试试
    272664150
        4
    272664150  
    OP
       Dec 21, 2017
    @celltree 就是想自己做个替换友盟和 bugly 的。。
    codezjx
        5
    codezjx  
       Dec 22, 2017
    272664150
        6
    272664150  
    OP
       Dec 26, 2017
    @codezjx 大神谢谢
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5642 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 03:48 · PVG 11:48 · LAX 20:48 · JFK 23:48
    ♥ Do have faith in what you're doing.