抓取perfetto trace:
2023-2-26 hongxi.zhu 已验证
(仅限于Andorid S及以上版本使用)
- 通过配置文件抓取:
cat config.pbtx | adb shell perfetto -c - --txt -o /data/misc/perfetto-traces/trace.perfetto-trace
adb pull /data/misc/perfetto-traces/trace.perfetto-trace
或者把配置文件放到手机里:
adb push config.pbtx /data/local/tmp/config.pbtx
adb shell 'cat /data/local/tmp/config.pbtx | perfetto --txt -c - -o /data/misc/perfetto-traces/trace.perfetto-trace'
adb pull /data/misc/perfetto-traces/trace.perfetto-trace
- 通过简单字段抓取
adb shell perfetto -o /data/misc/perfetto-traces/trace.perfetto-trace -t 20s -b 128m \
sched freq idle am wm gfx view binder_driver hal dalvik camera input res memory
adb pull /data/misc/perfetto-traces/trace.perfetto-trace