Code Monkey home page Code Monkey logo

mobileperf's Introduction

mobileperf

[US English]

mobileperf is a Python PC tool that can collect Android performance data: cpu,memory,fps,logcat log,traffic,process thread number,process launch log.mobileperf also support monkey test.

Features

  • Support most versions of Android OS from 5.0 to 10.0
  • No need root device,no need integrate SDK
  • Support Mac, linux, windows
  • Good stability, can run continuously for more than 72 hours
  • a little PC resource occupation, consume PC memory about 12M

Getting started

  • Python3,recommend python3.7

  • adb,ensure system path contains adb

  • edit config file in mobileperf root dir,example config.conf

  • run ,in mobileperf root dir,mac or linux execute sh run.sh ,windows double click run.bat,end test wait timeout or click ctrl+C

[简体中文]

mobileperf is python PC 工具,可以收集Android性能数据: cpu 内存 流畅度fps logcat日志 流量 进程线程数 进程启动日志,mobileperf也支持原生monkey test

特性

  • 支持Android5.0-10.0,兼容性好
  • 无需root设备,无需集成SDK,非侵入式,使用成本低
  • 支持mac linux windows
  • 稳定性好,能连续运行72小时以上
  • 少量占用PC资源,消耗PC内存约12M左右

使用方法

  • 安装python3.7 python下载链接,加入到环境变量中,执行python --version,确保是python3

  • 安装adb,确保adb devices能找到设备

  • 修改配置文件,示例参考根目录下config.conf

  • 运行,mac、linux 在mobileperf工具根目录下执行sh run.sh,windows 双击run.bat,结束测试,等待设置测试时长到或按Ctrl+C

mobileperf's People

Contributors

alibaba-oss avatar looklukelu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mobileperf's Issues

androiddevice.py在py3.7-pycharm中打开报错

image
问题如下:

  • 这里的super(RemoteADB 报错了,这块为啥要super呢?
  • from androiddriver.adb import RemoteADB ——这个也报错,androiddriver.adb是在哪里的呢,源码没看到哈
class RemoteADB(ADB):
    '''网络远程ADB
    '''

    def __init__(self, device_id):
        super(RemoteADB, self).__init__(device_id)
        from androiddriver.adb import RemoteADB

性能稳定性测试工具mobileperf使用总结(Android11下)

性能稳定性测试工具mobileperf使用总结(Android11下):
1、cpuinfo、 traffics(流量数据)、pss(实际使用的物理内存)、thread_num可以按照配置文件默认设置的每隔5秒去获取
2、meminfo内存是按照每50秒采集一次(未按照配置文件中的5秒),测了4次,其中有一次内存数据只有开头和结尾两个值,中间的部分未采集到。
3、fps获取不到,基本都是0
4、powerinfo电量获取不到,未生成有csv文件
5、测试完成后生成的报告excel中,仅有cpuinfo、meminfo、pid_change、pss_video,其他的如traffics没有

游戏类app的FPS采集到的都是 0

测试的游戏是Unity引擎开发。另外期待官方的meminfo的新的采集方案。我也觉得dumpsys meminfo性能有很大问题。但是Gamebench对meminfo的采集却感觉对app没有影响,觉得它应该用了什么黑科技吧。

It doesn't work on the secondary process

It just works on the main process, it doesn't work on the secondary process(subprocess), just like Wechat applet,maybe all of the data about the secondary process is wrong . so many apps have the secondary process now, it's better to support secondary process, it's better to show the total data of phone,so that we can avoid fatal mistakes.

(hprof文件是空的)The hprof file is empty

设置了三分钟和monkey,其他数据都有,但是hprof文件是空的。

I config the package, timeout(=3), monkey in the config.conf, but the hprof file is empty, other data of files are normal.

代码优化:win-pycharm打开report.py 里有报警

报警的代码:from excel import Excel
需要改为:from mobileperf.android.excel import Excel
否则在win-pycharm会提醒报警,因为python中有excel命名的包,会导致先找系统中的excel包里的Excel,然后没找到

# encoding: utf-8
'''
@author:     look
@copyright:  1999-2020 Alibaba.com. All rights reserved.
@license:    Apache Software License 2.0
@contact:    [email protected]
'''
import os
from datetime import datetime

from excel import Excel
from mobileperf.common.log import logger
from mobileperf.common.utils import 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.