一、tidevice获取性能数据
tidevice安装:pip3 install tidevice
获取全部性能数据:tidevice perf -B tv.danmaku.bilianime(包名)
获取指定性能数据:tidevice perf -B tv.danmaku.bilianime(包名) -o cpu/memory/network/fps
1、iOS CPU监控
tidevice perf -B tv.danmaku.bilianime -o cpu
timestamp: 时间戳,表示采样数据的时间点。
pid: 进程 ID,表示采样数据所属的进程的 ID。
value: CPU 使用率,表示应用程序的 CPU 使用率。(重点关注该值)
sys_value: 系统 CPU 使用率,表示系统整体的 CPU 使用率,单位为百分比。
count: 采样次数,表示该数据是基于多少次采样的平均值。
2、iOS 内存监控
tidevice perf -B tv.danmaku.bilianime -o memory
value: 内存使用量,表示应用程序在该时间点的内存使用量,单位是 MB(重点关注该值)
3、iOS 流量监控
tidevice perf -B tv.danmaku.bilianime -o network
RxBytes: 接收字节数。
TxBytes: 发送字节数。
4、fps 监控
tidevice perf -B tv.danmaku.bilianime -o fps
fps:帧率,每秒帧数。
二、instruments获取性能数据
instruments工具可以采集应用的CPU、内存等性能数据,但需要本地源码才能采集。对没有源码或者在appstore下载的app进行采集,会报签名错误。这里不过多介绍了~