-
进入debug 模式,打开 开发者模式 中的显示点按操作反馈
-
打开android Framework log
First, enable view input logs adb root adb shell "setprop mtk_d.viewroot.enable 707000" After framework restart(adb shell stop/start) enable native input logs /*inputReader touch 的log 开法 adb shell setprop sys.input.TouchFilterEnable true adb shell setprop sys.input.TouchFilterLogEnable true /*inputDispatcher的log 开法 adb shell setprop sys.inputlog.enabled true adb shell dumpsys input
复测前输入
adb shell setprop log.tag.InputDispatcherInboundEvent DEBUG
adb shell setprop log.tag.InputTransportTransportActions DEBUG
不用重启手机就可以生效,重启手机后会失效。
- 动态开启APP层LOG方法如下:
adb shell setprop debug.viewroot.enable 7000 (P版本这个属性名称换了,换成mtk_d.viewroot.enable了, 故P版本后这句要换成 adb shell setprop mtk_d.viewroot.enable 7000 ) adb shell setprop debug.view.keylog true adb shell setprop debug.view.touchlog true adb shell setprop debug.view.motionlog true adb shell setprop debug.inputclient.enable 1 adb shell stop adb shell start
需等待手机软重启后才能生效
- kernel event的查看方法
adb shell getevent -i
adb shell getevent -tlr
需添加的Log
在分析Touch问题时,可在Touch driver的中断函数中加入log对触摸进行追踪
例如如下log:
行 205417: <6>[13247.422097] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_ts_threadirq_func:1293] goodix_ts_threadirq_func IN! 行 205419: <6>[13247.423564] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1654] goodix_event_handler IN! 行 205422: <6>[13247.503799] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_i2c_read_trans:325] goodix_i2c_read_trans in 行 205427: <6>[13247.897794] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_i2c_read_trans:381] goodix_i2c_read_trans out 行 205429: <6>[13247.898684] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1670] ic_type = 3 行 205432: <6>[13248.223617] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1671] return checksum_u8_ys =0 行 205435: <6>[13248.284083] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1707] goodix_event_handler OUT! 行 205437: <6>[13248.367879] .(1)[7602:kworker/1:0][GTP-INF][goodix_i2c_read_trans:325] goodix_i2c_read_trans in 行 205438: <6>[13248.368066] .(1)[7602:kworker/1:0][GTP-INF][goodix_i2c_read_trans:381] goodix_i2c_read_trans out 行 205444: <6>[13248.478453] .(1)[433:irq/33-goodix_t][GTP-INF][goodix_ts_threadirq_func:1328] goodix_ts_threadirq_func OUT! 行 205446: <6>[13248.480243] .(6)[433:irq/33-goodix_t][GTP-INF][goodix_ts_threadirq_func:1293] goodix_ts_threadirq_func IN! 行 205448: <6>[13248.481548] .(6)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1654] goodix_event_handler IN! 行 205450: <6>[13248.900707] .(6)[433:irq/33-goodix_t][GTP-INF][goodix_i2c_read_trans:325] goodix_i2c_read_trans in 行 205451: <6>[13248.901870] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_i2c_read_trans:381] goodix_i2c_read_trans out 行 205453: <6>[13248.904084] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1670] ic_type = 3 行 205454: <6>[13248.904102] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1671] return checksum_u8_ys =0 行 205455: <6>[13248.918160] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1707] goodix_event_handler OUT! 行 205456: <6>[13248.919639] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_ts_threadirq_func:1328] goodix_ts_threadirq_func OUT! 行 205457: <6>[13248.921225] .(7)[433:irq/33-goodix_t][GTP-INF][goodix_ts_threadirq_func:1293] goodix_ts_threadirq_func IN! 行 205458: <6>[13248.922475] .(7)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1654] goodix_event_handler IN! 行 205459: <6>[13248.923628] .(7)[433:irq/33-goodix_t][GTP-INF][goodix_i2c_read_trans:325] goodix_i2c_read_trans in 行 205460: <6>[13248.925483] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_i2c_read_trans:381] goodix_i2c_read_trans out 行 205461: <6>[13248.926680] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1670] ic_type = 3 行 205462: <6>[13248.927706] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1671] return checksum_u8_ys =0 行 205463: <6>[13248.929092] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_event_handler:1707] goodix_event_handler OUT! 行 205464: <6>[13248.930501] .(0)[433:irq/33-goodix_t][GTP-INF][goodix_ts_threadirq_func:1328] goodix_ts_threadirq_func OUT!
通过log是否打出以及打出时间与流程可以对问题进行判断