WinScope web用来跟踪分析WindowManager或SurfaceFlinger在window转换期间和转换后的状态,跟踪记录会被写入 /data/misc/wmtrace/wm_trace.pb 和 /data/misc/wmtrace/layers_trace.pb,同时还会包含在错误报告中。
一、下载winscope.html
curl 'https://android.googlesource.com/platform/prebuilts/misc/+/master/common/winscope/winscope.html?format=TEXT' | base64 -d > winscope.html
二、 跟踪WindowManager
adb shell cmd window tracing start adb shell cmd window tracing stop adb pull /data/misc/wmtrace/wm_trace.pb wm_trace.pb 三、跟踪SurfaceFlinger
adb shell su root service call SurfaceFlinger 1025 i32 1 adb shell su root service call SurfaceFlinger 1025 i32 0 adb pull /data/misc/wmtrace/layers_trace.pb layers_trace.pb 四、浏览器打开WinScope.html,Open files加载想要的pb文件

参考: