Debug.startMethodTracing(getExternalFilesDir(null) + "/xbh.trace");
Debug.stopMethodTracing();
权限
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
指定目录下会生成.trace
adb导出.trace文件到电脑
C:\Users\xubinhong>
adb pull
/storage/emulated/0/Android/data/com.example.myapplication/files/xbh.tracexbh.trace
然后就到了我的C:\Users\xubinhong文件夹下
然后DDMS中file open file
AS3.1后需要到sdk/tools/monitor.bat下去打开DDMS
我是新手,对于他的时间,可以让我更容易地定位性能瓶颈,这很好
更详细的分析和使用可以看https://www.jianshu.com/p/388c693c1b58