Android Device Monitor的使用

Android Device Monitor使用

Android Device Monitor是Google SDK套件中的一个调试工具。里面包含了好几种调试工具,包括DDMS、Hierarchy View、Debug、Tracer for OpenGL ES、Pixel Perfect,其中通过DDMS开发人员可以通过他看到目标设备上运行的程序,可以查看内存分配情况,可以模拟向设备打电话发短信还可以发送地理信息位置。通过Hierarchy View可以看到目前屏幕上的布局信息。接下来我就介绍下DDMS和Hierarchy View的使用。

一、DDMS

(1)、Emulator Control

通过Emulator Control 我们可以模拟传感器,来电等数据。当然,Emulator Contorl只有Google原版镜像才可以用,如果模拟器里或手机里不是Google源码镜像,这里的内容都会变成灰色。

Android Device Monitor的使用

模拟来电

Android Device Monitor的使用
Android Device Monitor的使用

模拟发送短信

Android Device Monitor的使用

(2)、File Explorer

File Explorer可以让我们浏览手机里的文件。

Android Device Monitor的使用

(3)、System Information

在这里我们可以看到CPU、内存占用情况。
Android Device Monitor的使用
Android Device Monitor的使用

(4)、屏幕截图

Android Device Monitor的使用
Android Device Monitor的使用

二、Hierarchy View

按Devices里的按钮Dump View Hierarchy for UI Automator可以获得当前屏幕上面的元素组成。

Android Device Monitor的使用

例如Google浏览器

Android Device Monitor的使用

可以看到Google浏览器当前界面的布局,view id,view的类,是否勾选等信息。

Android Device Monitor的使用
Android Device Monitor的使用