Android界面元素解析uiautomatorviewer
已有 1228 次閱讀2020-2-1 21:28
|
安卓
<div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">一」</span><span style="font-family: "Courier New"; font-stretch: normal; font-variant-ligatures: no-common-ligatures; line-height: normal;">uiautomatorviewer</span></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><span style="font-stretch: normal; font-variant-ligatures: no-common-ligatures; line-height: normal;">1,首先进行</span><span style="font-stretch: normal; font-variant-ligatures: no-common-ligatures; line-height: normal;">uiautomatorviewer的</span><span style="font-stretch: normal; font-variant-ligatures: no-common-ligatures; line-height: normal;">环境变量的配置</span></font></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New"; font-stretch: normal; font-variant-ligatures: no-common-ligatures; line-height: normal;">「1」</span><span style="font-family: "Courier New";">命令行查看对应的安装路径:</span></div><div style="-webkit-text-size-adjust: auto; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902);"><div><font face="Courier New" style="font-size: 14px;"> ~ % which uiautomatorviewer</font></div><div><font face="Courier New" style="font-size: 14px;">/Users/gaijinfeng/android-sdk-macosx/tools/uiautomatorviewer</font></div></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><img width="811" src="blob:http://www.linuxidc.net/895d4afc-4ee8-4de0-ac00-26f68323c59e"><br></font></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New"; font-stretch: normal; font-variant-ligatures: no-common-ligatures; line-height: normal;">「2」</span><span style="font-family: "Courier New";">通过find命令来去android sdk里面查找uiautomatorviewer安装的路径:</span></div><div style="-webkit-text-size-adjust: auto; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902);"><div><font face="Courier New" style="font-size: 14px;"> ~ % find /Users/gaijinfeng/android-sdk-macosx/ -name uiautomatorviewer</font></div><div><font face="Courier New" style="font-size: 14px;">/Users/gaijinfeng/android-sdk-macosx//tools/uiautomatorviewer</font></div></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New"; font-stretch: normal; font-variant-ligatures: no-common-ligatures; line-height: normal;">「3」</span><span style="font-family: "Courier New";">把对应的路径加到path路径下,保存好后记得执行</span><span style="font-family: "Courier New"; font-stretch: normal; font-variant-ligatures: no-common-ligatures; line-height: normal;">source ~/.bash_profile使环境变量生效。</span></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">2,进行界面到</span><span style="font-family: "Courier New"; font-stretch: normal; font-variant-ligatures: no-common-ligatures; line-height: normal;">uiautomatorviewer</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New"; font-stretch: normal; font-variant-ligatures: no-common-ligatures; line-height: normal;">「1」命令行输入</span><span style="font-family: "Courier New";"> </span><span style="font-family: "Courier New"; font-stretch: normal; font-variant-ligatures: no-common-ligatures; line-height: normal;">uiautomatorviewer,直接打开对应的界面</span></div><div style="-webkit-text-size-adjust: auto; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902);"><font face="Courier New" style="font-size: 14px;">~ % uiautomatorviewer</font></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><img width="411" src="blob:http://www.linuxidc.net/df395a30-d16f-4695-9951-466f977e09cc"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">「2」查看打开后的界面,及如何映射</span></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><img width="398" src="blob:http://www.linuxidc.net/a978621d-0bf4-447a-a7cd-6745b5e09a32"><img width="438" src="blob:http://www.linuxidc.net/8aea3997-93f8-46df-b98d-577133b4d8a6"><br></font></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New"; font-stretch: normal; font-variant-ligatures: no-common-ligatures; line-height: normal;">3,</span><span style="font-family: "Courier New";">下面以雪球app为例进行界面元素的解析讲解:</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">{1}控件类型:</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";"> class「android.widget.TextView」</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";"> 如果是TextView会有对应的text属性描述且不为空,其他也有但是多数为空</span></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><img width="360" src="blob:http://www.linuxidc.net/acd46fdc-f720-498f-9054-7f7c1ab0c12e"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">{2}资源定位符:</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";"> resource-id「com.xueqiu.android:id/title_text」</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">{3}内容描述:</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";"> content-desc{给盲人用的,如果有内容,盲人使用时则可读出来对应的介绍信息}增强可访问性的</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">{4}展示文本:</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";"> text{如果是TextView控件,会有一个不为空的text属性,其他的控件也有,但是多数为空}</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">{5}父控件的第几个子元素:</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";"> index{下标从0开始}</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">{6}是否是有复选框「false,没有」</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";"> checkable、checked </span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">{7}是否是可以被点击的「false,不可被点击,但是上一级框有对应的clickable值为true」</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";"> clickable </span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";"> 这时虽然该控件不可以被点击但是上层的元素对应的clickable为true,则进行点击时,上层也是可以捕捉到对应的点击事件的</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">{8}位置:控件的边界值</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";"> bounds</span><span style="caret-color: rgb(51, 51, 51); letter-spacing: 0.44999998807907104px; font-family: "Courier New"; color: rgb(51, 51, 51);"> [111,108][187,174]</span></div><div style="-webkit-text-size-adjust: auto;"><img width="339" src="blob:http://www.linuxidc.net/7e350a20-72db-48aa-b31f-e543dd8aa7a1"><span style="font-family: "Courier New";"> </span></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><img src="blob:http://www.linuxidc.net/c7544dd6-65c3-44f1-9872-c64e91220899"><br></font></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><img src="blob:http://www.linuxidc.net/9de10c53-5ec4-45df-bc5d-09a7fa9eb10c"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">4,android界面也可以被存储到本地</span></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><img width="365" src="blob:http://www.linuxidc.net/61be8159-f979-40bc-a386-f9d9dd988cbb"><br></font></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">history 查看历史命令</span></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">adb shell uiautomator</span></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><img src="blob:http://www.linuxidc.net/3cba955d-091e-4035-9695-a76327ff28dd"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">执行完该命令后,最后有一个数据解释dump命令</span></div><div style="-webkit-text-size-adjust: auto; box-sizing: border-box; caret-color: rgb(34, 37, 39); letter-spacing: 0.44999998807907104px; margin-top: 1em; margin-bottom: 1em;"><span style="box-sizing: border-box;"><span style="color: rgb(34, 37, 39); line-height: 26px; font-family: "Courier New";">dump命令</span></span></div><div style="-webkit-text-size-adjust: auto; box-sizing: border-box; overflow: auto; padding: 5px 15px; word-break: break-all; word-wrap: break-word; background-color: rgb(249, 249, 249); border-width: 1px 0px; border-top-style: solid; border-bottom-style: solid; border-top-color: rgb(240, 240, 240); border-bottom-color: rgb(240, 240, 240); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; letter-spacing: 0.44999998807907104px;"><div><font face="Courier New"><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(160, 160, 0); line-height: 18px; border: none !important;">dump:</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">creates</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">an</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">XML</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">dump</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">of</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">current</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">UI</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">hierarchy</span></font></div><div><font face="Courier New"><br></font></div><div><font face="Courier New"><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">dump</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(102, 102, 102); line-height: 18px; border: none !important;">[--</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">verbose</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(102, 102, 102); line-height: 18px; border: none !important;">][</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">file</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(102, 102, 102); line-height: 18px; border: none !important;">]</span></font></div><div><font face="Courier New"><br></font></div><div><font face="Courier New"><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(102, 102, 102); line-height: 18px; border: none !important;">[--</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">compressed</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(102, 102, 102); line-height: 18px; border: none !important;">]:</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">dumps</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">compressed</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">layout</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">information</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(102, 102, 102); line-height: 18px; border: none !important;">.</span></font></div><div><font face="Courier New"><br></font></div><div><font face="Courier New"><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(102, 102, 102); line-height: 18px; border: none !important;">[</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">file</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(102, 102, 102); line-height: 18px; border: none !important;">]:</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">the</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">location</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">where</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">the</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">dumped</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">XML</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">should</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">be</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">stored</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(102, 102, 102); line-height: 18px; border: none !important;">,</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(170, 34, 255); font-weight: bold; line-height: 18px; border: none !important;">default</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">is</span></font></div><div><font face="Courier New"><br></font></div><div><font face="Courier New"><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;"> </span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(102, 102, 102); line-height: 18px; border: none !important;">/</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">sdcard</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(102, 102, 102); line-height: 18px; border: none !important;">/</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(68, 68, 68); line-height: 18px; border: none !important;">window_dump</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(102, 102, 102); line-height: 18px; border: none !important;">.</span><span style="box-sizing: border-box; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: pre-wrap; word-break: break-all; color: rgb(187, 68, 68); line-height: 18px; border: none !important;">xml </span></font></div></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><br></font></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><img width="408" src="blob:http://www.linuxidc.net/bc9ca875-2555-45ed-be77-0dd6b884cc0c"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">1,会生成/sdcard/window_dump.xml这样一个文件 </span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">adb shell uiautomator dump</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">2,打开文件查看</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">adb shell cat /scard/window_dump.xml</span></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><img width="732" src="blob:http://www.linuxidc.net/1497b020-c18b-49de-87a6-a0d4048d7a8a"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">3,压缩文件,进行</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">adb shell uiautomator dump —compressed /scard/window_dump2.xml</span></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><img width="609" src="blob:http://www.linuxidc.net/1705add2-6ed5-4ba4-b5e7-6204c10ef12d"><br></font></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">4,对比两个文件大小</span></div><div style="-webkit-text-size-adjust: auto;"><span style="font-family: "Courier New";">adb shell “ls -l /sdcard/*.xml"</span></div><div style="-webkit-text-size-adjust: auto;"><font face="Courier New"><img width="685" src="blob:http://www.linuxidc.net/869b69b9-5d36-47d4-9320-563a42e3d10d"><br></font></div><div style="-webkit-text-size-adjust: auto;"></div>