先在方法最前面插桩:

1.Trace.beginSection("methodName");

或者TraceCompat.beginSection("methodName");

方法最后:

Trace.endSection();

或者

TraceCompat.endSection();

2.然后开始执行:

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

等待命令行出现:

Starting tracing (20 seconds)

3.然后开始操作APP,执行方法介绍后,打开

~/Documents/log.html进行分析

更多相关文章

  1. Android Studio集成Library时报错,终极解决方法
  2. Android从服务器获取图片的实例方法
  3. android屏幕休眠和唤醒两种方法(newWakeLock)
  4. Android 数据库事务操作
  5. android添加图片到本地,无法即使刷新的解决方法
  6. Android每天定时任务启动方法
  7. android Timer使用方法
  8. Android 使用git下载源码报错解决方法
  9. Android中的onCreateOptionsMenu()方法和onOptionsItemSelected()方

随机推荐

  1. android 源码下载 ARM/x86架构
  2. android中访问时的localhost问题
  3. Android(安卓)ListView详解
  4. google maps api 地址
  5. Android(安卓)Activity界面切换添加动画
  6. android 服务前台运行startForeground
  7. 第一节(搭建环境)
  8. Android系统信息获取
  9. android中GridView关于间距的属性值介绍
  10. android工具链与GNU工具链的比较