基于Python收集Android/iOS性能指标

GitHub - smart-test-ti/SoloX: SoloX - Real-time collection tool for Android performance data.(移动端性能测试\APP性能测试\Android性能测试)SoloX - Real-time collection tool for Android performance data.(移动端性能测试\APP性能测试\Android性能测试) - GitHub - smart-test-ti/SoloX: SoloX - Real-time collection tool for Android performance data.(移动端性能测试\APP性能测试\Android性能测试)https://github.com/smart-test-ti/SoloX

from solox.public.apm import APM
# pip3 install -U solox (solox version must be >= 2.1.2)

apm = APM(pkgName='com.bilibili.app.in',deviceId='ca6bd5a5',platform='Android')
# apm = APM(pkgName='com.bilibili.app.in', platform='iOS') only supports one device
cpu = apm.collectCpu() # %
memory = apm.collectMemory() # MB
flow = apm.collectFlow() # KB
fps = apm.collectFps() # HZ
battery = apm.collectBattery() # level:% temperature:°C


输出结果
[I 220821 15:47:38 apm:305] cpu: {'appCpuRate': 0.09, 'systemCpuRate': 10.52}
[I 220821 15:47:39 apm:312] memory: {'totalPass': 232.42, 'nativePass': 19.28, 'dalvikPass': 0.0}
[I 220821 15:47:40 apm:326] network: {'upFlow': 1.48, 'downFlow': 0.0}
[I 220821 15:47:42 apm:333] fps: {'fps': 0, 'jank': 5}
[I 220821 15:47:43 apm:319] battery: {'level': 98, 'temperature': 36.2}

你可能感兴趣的:(APP性能测试,python,性能优化,android,测试工具)