在平时开发和处理bug的过程中经常会和EventLog打交到,通过EventLog来分析Activity、Process、CPU、Window等相关信息。
在开发调试中可以通过如下命令查看EventLog信息:
adb logact -b events
焦点切换events log分析
events log 搜索input_focus
焦点切换时中间会经过null APP1=>null=>APP2
2321 2996 I input_focus: [Focus leaving 841fcf com.android.settings/com.android.settings.SubSettings (server),reason=Waiting for window because NO_WINDOW] //焦点离开
2321 2527 I input_focus: [Focus request b5de6b1 com.android.settings/com.android.settings.SubSettings,reason=UpdateInputWindows] //焦点申请
2321 2996 I input_focus: [Focus entering b5de6b1 com.android.settings/com.android.settings.SubSettings (server),reason=Window became focusable. Previous reason: NOT_VISIBLE] //焦点进入
2321 2527 I input_focus: [Requesting to set focus to null window,reason=UpdateInputWindows]
2321 2996 I input_focus: [Focus leaving b5de6b1 com.android.settings/co