先在方法最前面插樁:
1.Trace.beginSection("methodName");
或者TraceCompat.beginSection("methodName");
方法最后:
Trace.endSection();
或者
TraceCompat.endSection();
2.然后開始執(zhí)行:
python /Users/qiluo/Library/Android/sdk/platform-tools/systrace/systrace.py -t 20 sched gfx view wm am app webview -a "packageName" -o ~/Documents/log.html
等待命令行出現(xiàn):
Starting tracing (20 seconds)
3.然后開始操作APP,執(zhí)行方法介紹后宏悦,打開
~/Documents/log.html進行分析