zoukankan      html  css  js  c++  java
  • Android app专项测试之耗电量测试

    一、前言
    耗电量指标
    待机时间成关注目标
    提升用户体验
    通过不同的测试场景,找出app高耗电的场景并解决

    二、需要的环境准备
    1、python2.7(必须是2.7,3.X版本是不支持的)
    2、golang语言的开发环境
    3、Android SDK
    此三个的环境搭建这里就不详细说了,自行在网上找资料吧

    三、battery-historian服务搭建
    1、克隆安装包
    git clone https://github.com/google/battery-historian.git
    2、下载battery-historian的代码和依赖
    go get -d -u github.com/google/battery-historian/...
    3、修改setup.go文件的参数
    closureCompilerVersion = "20170409"
    值修改为
    closureCompilerVersion = "20190513"
    因为版本不一样,编译会失败,所以升级到稳定版本
    4、切换到setup.go所在的目录,进行编译
    go run setup.go


    5、启动battery-historian服务
    go run cmd/battery-historian/battery-historian.go


    6、验证是否安装成功
    http://localhost:9999/,出现如下,则ok

    四、进行耗电量数据收集
    1、清理耗电量数据
    adb kill-server
    adb start-server
    adb shell dumpsys batterystats --reset
    adb shell dumpsys batterystats --enable full-wake-history
    2、运行测试用例/手工操作
    使用monkey或appium来操作想要被测试的Android应用,最好就持续几个钟,效果才比较明显,这里具体就不展开详细说明了
    3、收集数据
    Android 7.0以上版本使用的命令 :adb bugreport bugreport.zip
    Android 6.0 或以下使用的命令: adb bugreport > bugreport.txt

    五、上传数据,进行数据分析

    知道、想到、做到、得到
  • 相关阅读:
    表格标签
    常用标签
    标签笔记
    基础标签与格式
    态度!
    如何修改数据 练习
    增删查练习
    登陆注册练习
    PHP 数据访问
    PHP 基础知识测试题 答案分析
  • 原文地址:https://www.cnblogs.com/Durant0420/p/13433747.html
Copyright © 2011-2022 走看看