当前位置: 首页 > news >正文

adb shell setprop 、开发者选项

App性能调试详解

Android App性能监控工具

更多系统属性参考

一、开启 GPU Render 的profiling bar: Gpu渲染速度

adb shell setprop debug.hwui.profile true
adb shell setprop debug.hwui.profile visual_bars 
adb shell setprop debug.hwui.profile visual_linesadb shell setprop debug.hwui.profile false#控制汇总条长度
adb shell setprop debug.hwui.profile.maxframes 400 

效果如下:

在这里插入图片描述

其中, Android 6.0 及更高版本的设备时分析器输出中某个竖条的每个区段如下所示:

在这里插入图片描述
下表显示的是 Android 4.0 和 5.0 中的竖条区段。

在这里插入图片描述

系统源码 :

/*** System property used to enable or disable hardware rendering profiling.* The default value of this property is assumed to be false.* When profiling is enabled, the adb shell dumpsys gfxinfo command will* output extra information about the time taken to execute by the last* frames.* Possible values:* "true",        to enable profiling* "visual_bars", to enable profiling and visualize the results on screen* "false",       to disable profiling* @see #PROFILE_PROPERTY_VISUALIZE_BARS* @hide*/
public static final String PROFILE_PROPERTY = "debug.hwui.profile";
/*** System property used to specify the number of frames to be used* when doing hardware rendering profiling.* The default value of this property is #PROFILE_MAX_FRAMES.** When profiling is enabled, the adb shell dumpsys gfxinfo command will* output extra information about the time taken to execute by the last* frames.** Possible values:* "60", to set the limit of frames to 60*/
static final String PROFILE_MAXFRAMES_PROPERTY = "debug.hwui.profile.maxframes";

二、打开 Overdraw 检查 : GPU过度绘制

adb shell setprop debug.hwui.overdraw show# adb shell setprop debug.hwui.overdraw false

在这里插入图片描述

在这里插入图片描述

系统源码:

/** Controls overdraw debugging.** Possible values:* "false", to disable overdraw debugging* "show",  to show overdraw areas on screen* "count", to display an overdraw counter** @hide*/
public static final String DEBUG_OVERDRAW_PROPERTY = "debug.hwui.overdraw";

三、开启显示各个view的布局线 : 布局边界

adb shell setprop debug.layout true# adb shell setprop debug.layout false

在这里插入图片描述

系统源码 :

/*** When set to true, apps will draw debugging information about their layouts.** @hide*/
public static final String DEBUG_LAYOUT_PROPERTY = "debug.layout";

参考

四、查看dirty区域:

adb shell setprop debug.hwui.show_dirty_regions trueadb shell setprop debug.hwui.render_dirty_regions true

系统源码:

/**
* System property used to enable or disable dirty regions invalidation.
* This property is only queried if {@link #RENDER_DIRTY_REGIONS} is true.
* The default value of this property is assumed to be true.
*
* Possible values:
* "true",  to enable partial invalidates
* "false", to disable partial invalidates
*/
static final String RENDER_DIRTY_REGIONS_PROPERTY = "debug.hwui.render_dirty_regions";/**
* Turn on to draw dirty regions every other frame.
*
* Possible values:
* "true",  to enable dirty regions debugging
* "false", to disable dirty regions debugging
*
* @hide
*/
public static final String DEBUG_DIRTY_REGIONS_PROPERTY = "debug.hwui.show_dirty_regions";

五、log日志

# 使能所有log tag 输出,设置所有log V等级及以上的log才能输出
adb shell setprop persist.log.tag V
http://www.lryc.cn/news/141927.html

相关文章:

  • 性能测试面试问题,一周拿3个offer不嫌多
  • Android Bitmap压缩
  • 不同子网络中的通信过程
  • Ubuntu Touch OTA-2 推出,支持 Fairphone 3 和 F(x)tec Pro1 X
  • 【网络】数据链路层——MAC帧协议 | ARP协议
  • 【Spring Boot】Spring Boot自动加载机制:简化应用程序的启动
  • centos7搭建apache作为文件站后,其他人无法访问解决办法
  • 【开个空调】语音识别+红外发射
  • 【hibernate validator】(二)声明和验证Bean约束
  • Redis持久化机制之RDB,AOF与混合AOF
  • 为啥外卖小哥宁愿600一月租电动车,也不花2、3千买一辆送外卖!背后的原因......
  • 分布式定时任务框架Quartz总结和实践(2)—持久化到Mysql数据库
  • Linux 服务器搭建配置,开发效率一飞冲天 - Centos 篇
  • Day46|leetcode 139.单词拆分
  • 深入理解高并发编程 - Thread 类的 stop () 和 interrupt ()
  • C语言之三子棋游戏实现篇
  • jupyter notebook 插件nbextensions的安装
  • Spring boot 集成单元测试
  • 基于C++的QT实现贪吃蛇小游戏
  • Spring Boot整合RabbitMQ之路由模式(Direct)
  • 行式存储与列式存储
  • windows上sqlserver的ldf日志文件和数据mdf文件分别放到不同的磁盘
  • vue3+uni——watch监听props中的数据(组件参数接收与传递defineProps、defineEmits)
  • mybatis与spring集成与spring aop集成pagehelper插件
  • Mybatis基础
  • TypeScript-- 配置Typescript环境(1)ts 转js,tsc --watch 实时编译
  • Dockerfile快速搭建自己专属的LAMP环境,生成镜像lamp:v1.1,并推送到私有仓库
  • Lottery抽奖项目学习第二章第一节:环境、配置、规范
  • OpenCV之reshape函数
  • 【JavaEE】Spring事务-@Transactional参数介绍-事务的隔离级别以及传播机制