iOS性能测试
使用tidevice
github: https://github.com/alibaba/taobao-iphone-device/blob/main/README.md
import tidevice
import time
from tidevice._perf import DataType
t = tidevice.Device()
# perf = tidevice.Performance(t, [DataType.CPU, DataType.MEMORY, DataType.NETWORK, DataType.FPS, DataType.PAGE, DataType.SCREENSHOT])
perf = tidevice.Performance(t, [DataType.CPU, DataType.MEMORY])
# tidevice version <= 0.4.16:
# perf = tidevice.Performance(t)
def callback(_type: tidevice.DataType, value: dict):
print("R:", _type.value, value)
perf.start("com.haohan.hhbusiness", callback=callback)
time.sleep(30)
perf.stop()