怎样抓webview的trace
1.DevTools简介
DevTools 是Google提供给Android开发者的一个调试工具,用于调试自己开发的APP内嵌的WebView的内容,具体用法可以参考Google官方文档:
https://developers.google.com/web/tools/chrome-devtools/remote-debugging/
https://developers.google.com/web/tools/chrome-devtools/remote-debugging/webviews
2.抓webview trace步骤
1.机器烧录eng或者usedebug的固件,打开usb调试;
2.打开chrome浏览器,在URL栏输入:chrome://inspect/?tracing
3.机器连接电脑,打开测试APP。Remote Target可以看到连接的设备和打开的webview页面(如果没有,一般原因是adb没有打开,或者固件是user版本)。
点击trace:
4.点击Record:
5.点击Edit categories:
6.依次选择ALL,最后点击Record:
7. 开始记录:
8.Stop之后保存:
9.分析trace
打开 chrome 浏览器,在 URL 栏输入 chrome://tracing/
点击Load,加载trace文件: