• Battery Historian之App耗电量测试


    一、Battery Historian测试所需环境:Go+Git+Python+Java+Battery Historian源码

    下载Battery Historian源码并且运行的步骤如下:

    1.打开Git Bash 输入命令行go get -d -u github.com/google/battery-historian/...    (注意:命令后面有三个点)

    2.进入到$GOPATH/src/github.com/google/battery-historian目录下方

    3.运行Battery Historian,命令:go run setup.go

    二、打开浏览器,访问地址
    http://localhost:9999/

    三、生成adb采集日志文件txt, 执行步骤
    1.adb shell dumpsys batterystats --enable full-wake-history
    2.adb shell dumpsys batterystats --reset
    3.拔出USB
    4.执行测试用例
    5.adb bugreport > filename.txt
    6.adb shell dumpsys batterystats --disable full-wake-history

    四、将filename.txt文件上传到http://localhost:9999/ 的“Power Monitor File” 提交后会自动分析

    五、关注Battery Level 曲线,在app Selection选择测试的app,在右侧查看App Stats,关注以下指标值

        --Devices estimated power use

        --Foreground

        --Services下方的相关进程

        --Process info

  • 相关阅读:
    Pycharm 2016 注册码
    在mac上搭建python环境
    Carthage 的使用
    生成唯一的随机字符串
    utf-8 转码--网址转码
    让自己的项目支持 Carthage
    系统自带的语音合成
    个性化 UIAlertController
    cocoaPods 创建自己的依赖库
    appleDoc 使用
  • 原文地址:https://www.cnblogs.com/luihengk/p/9004163.html
Copyright © 2020-2023  润新知