Android Perfiler 性能分析工具(一)如何使用-- Android APP 性能追踪与分析工具

463 阅读1分钟

创作不易希望能一键三连哦~点赞👍、收藏🌟、加关注➕,随用随学不迷路~

接上篇Perfetto 抓取 trace 使用详解 -- Android APP 性能追踪与分析工具 - 掘金 (juejin.cn)在学习了如何进行trace的抓取后接下来我们就要对trace进行分析,来确定APP的优化方向。

写在最前面,Android Studio Perfiler 都可以分析哪些问题?

  • CPU性能分析
  • 内存性能分析
  • 电池性能分析
  • 网络性能分析

分析工具的使用

Android Studio 自带 Perfiler 性能分析工具

Android Studio 3.0 及更高版本中的 Android Profiler 取代了 Android Monitor 工具。

打开工具

1. 在 Android Studio 中,依次选择 View > Tool Windows > Profiler,或点击工具栏中的 Profile 图标。

image.png image.png

2. 点击➕建立新的session连接

image.png

3. 打开如图,可以看到CPU、MEMORY、ENERGY三个实时性能波动图表(不同版本的Studio会有不一样,文中使用的是Android Studio Flamingo | 2022.2.1 Patch 2)

image.png

创作不易希望能一键三连哦~点赞👍、收藏🌟、加关注➕,随用随学不迷路~