Android抓取火焰图

Android抓取火焰图

1.通过adb命令在设备上抓取perf.data数据
adb shell simpleperf record -p 2573 -g --duration 5 -o /sdcard/perf.data

如果报错没有权限,执行adb root & adb remount即可

这里的2573为进程的PID可以通过adb shell ps | grep 包名 得到

2.抓取完后pull出来,这里需要ndk(在ndk目录下执行report_html.py文件),命令如下
python report_html.py -i E:\perf.data -o E:\perf.html

这时候就会转换出html的火焰图文件了

E:\perf.data为pull出来的data文件完整路径,E:\perf.html为输出文件的完整路径
report_html.py文件目录一般是sdk\ndk\29.0.14206865\simpleperf (版本跟随自己的下载的版本号不定)

相关推荐
阿pin15 小时前
Android随笔-kotlin withContext
android·kotlin·withcontext
树码小子15 小时前
开启 IDEA 中的断言功能
android·java·intellij-idea
Kslient15 小时前
HeaderBehavior
android
Android-Flutter16 小时前
android 动画详解
android·kotlin
小孔龙1 天前
GraphicBuffer 跨进程共享
android
行业研究员1 天前
Android内置GPS与腾讯地图定位技术对比分析
android·android定位·腾讯地图定位
Android-Flutter1 天前
android WMS 详解(二)
android·kotlin
游戏开发爱好者81 天前
App Store 上传 IPA 自动化,.p8 密钥认证与 CI/CD 接入实战
android·运维·ci/cd·小程序·uni-app·自动化·iphone
游戏开发爱好者81 天前
iOS 推送怎么配置,APNs 推送证书、设备库与群发
android·ios·小程序·https·uni-app·iphone·webview
阿pin1 天前
Android随笔-kotlin 高阶函数
android·kotlin·高阶函数