TraceView报错:unable to open trace file

2018-03-13 22:42:44

程序效率有些问题,想起用TraceView来分析一下,可是一直报标题中的错误,无法创建出我所需要的aa.trace文件,分析也就无从做起。


上网查了一些资料好多都说是没有添加权限造成的,好吧,我承认一开始确实没有添加权限,按网上的说法把这一句加到了Manifest.xml中:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>


可是问题依旧呀,后来继续查找资料,才发现问题出在了Android的安全机制上面,所以将所要生成的文件添加上该应用对应的路径,问题解决了!

在oncrete()中将Debug.startMethodTracing("aa.trace")修改为:

Debug.startMethodTracing("/data/data/com.yourapp/aa.trace"),问题解决。



  • 2017-02-10 16:22:13

    git历史记录查询

    查看提交历史:git log 查看提交历史并显示版本间的差异:git log -p 查看指定历史:git log xxx(sha1值) -p 查看提交历史(指定时间):

  • 2017-02-13 17:50:05

    cURL error 60: SSL certificate problem: unable to get local issuer certificate

    Drupal 8 version uses Guzzle Http Client internally, but under the hood it may use cURL or PHP internals. If you installed PHP cURL on your PHP server it typically uses cURL and you may see an exception with error Peer certificate cannot be authenticated with known CA certificates or error code CURLE_SSL_CACERT (60).

  • 2017-02-16 08:09:01

    HTML中PRE和p的区别

    pre 元素可定义预格式化的文本。被包围在 pre 元素中的文本通常会保留空格和换行符。而文本也会呈现为等宽字体。 <pre> 标签的一个常见应用就是用来表示计算机的源代码。

  • 2017-02-16 15:14:14

    动态加载js和css

    开发过程中经常需要动态加载js和css,今天特意总结了一下常用的方法。