﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-小蚂蚁-随笔分类-软件测试_徒弟的文档</title><link>http://www.blogjava.net/lijun_li/category/54474.html</link><description>风雨过后才见彩虹</description><language>zh-cn</language><lastBuildDate>Thu, 31 Jul 2014 11:36:48 GMT</lastBuildDate><pubDate>Thu, 31 Jul 2014 11:36:48 GMT</pubDate><ttl>60</ttl><item><title>分享：ADB工具的安装与卸载命令的实践！！！</title><link>http://www.blogjava.net/lijun_li/archive/2014/07/31/416417.html</link><dc:creator>lijun</dc:creator><author>lijun</author><pubDate>Thu, 31 Jul 2014 10:33:00 GMT</pubDate><guid>http://www.blogjava.net/lijun_li/archive/2014/07/31/416417.html</guid><wfw:comment>http://www.blogjava.net/lijun_li/comments/416417.html</wfw:comment><comments>http://www.blogjava.net/lijun_li/archive/2014/07/31/416417.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/lijun_li/comments/commentRss/416417.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/lijun_li/services/trackbacks/416417.html</trackback:ping><description><![CDATA[<span style="font-family: Tahoma; font-size: 10pt;">编写背景：</span><br />&nbsp; &nbsp; &nbsp;&nbsp;<span style="font-size: 10pt; font-family: Tahoma;">一年多没有更新blog,有很多东西很想给同行分享,但是总没有刺激我动手放上来的动力。也许是真的老了、也许是自己的重心转移了。最近又开始带徒弟了,她学习的热情感染了我，因此决定在blog上开了这么一个归类：软件测试_徒弟的文档。</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;"><br /></span><p class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" style="font-size:16.0pt;font-family:黑体">ADB</span><span style="font-size:16.0pt;
font-family:黑体">工具的安装与卸载命令的实践<span lang="EN-US"><o:p></o:p></span></span></p>

<p class="MsoNormal" align="left"><span style="font-size:
12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:
宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast">作者：李玉玲<span lang="EN-US"><o:p></o:p></span></span></p>

<p class="MsoNormal" align="left"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:
minor-fareast">&nbsp; &nbsp;&nbsp;</span><span lang="EN-US" style="font-size: 12pt; font-family: 宋体;">adb</span><span style="font-size: 12pt; font-family: 宋体;">工具的作用就是连接安卓操作系统；下面分享<span lang="EN-US">ADB</span>工具的安装和卸载命令实践。<br /></span><span style="font-size: 16pt; line-height: 240%; font-family: 黑体;">一、安装<span lang="EN-US">adb</span></span><span style="font-size: 16pt; line-height: 240%; font-family: 黑体;">工具的前提<br /></span><span lang="EN-US" style="font-size: 14pt; line-height: 172%; font-family: 黑体;">1</span><span style="font-size: 14pt; line-height: 172%; font-family: 黑体;">、查看盒子是否开启<span lang="EN-US">adb</span></span><span style="font-size: 14pt; line-height: 172%; font-family: 黑体;">的功能</span></p>

<p class="MsoNormal" align="left" style="text-indent: 24pt;"><span style="font-size:12.0pt;font-family:宋体;
mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:
minor-fareast;mso-hansi-theme-font:minor-fareast;color:red">查看盒子是否开启<span lang="EN-US">adb</span>功能，需要使用&#8220;<span lang="EN-US">ping </span>盒子<span lang="EN-US">IP&#8221;</span>，如果通过但是&#8220;<span lang="EN-US">adb connection </span>盒子<span lang="EN-US">IP&#8221;</span>连接失败，则没有开启<span lang="EN-US">adb</span>功能。这时候，需要用<span lang="EN-US">USB</span>连接盒子和<span lang="EN-US">PC</span>，根据开发人员提供的升级安装包进行升级，即可开启<span lang="EN-US">adb</span>功能。<span lang="EN-US"><o:p></o:p></span></span></p>

<p class="MsoNormal" align="left" style="text-indent: 24pt;"><span style="font-size:12.0pt;font-family:宋体;
mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:
minor-fareast;mso-hansi-theme-font:minor-fareast">本次使用的是<span lang="EN-US">Q12</span>机顶盒。它默认开通了<span lang="EN-US">adb</span>功能。只有XXXXX的版本才禁掉了<span lang="EN-US">adb</span>功能。<span lang="EN-US"><o:p></o:p></span></span></p>

<h2 style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:
0cm;mso-para-margin-top:.5gd;mso-para-margin-right:0cm;mso-para-margin-bottom:
.5gd;mso-para-margin-left:0cm;line-height:172%"><span lang="EN-US" style="font-size:14.0pt;line-height:172%;font-family:黑体;font-weight:normal;
mso-bidi-font-weight:bold">2</span><span style="font-size:14.0pt;line-height:
172%;font-family:黑体;font-weight:normal;mso-bidi-font-weight:bold">、获取盒子的<span lang="EN-US">IP<o:p></o:p></span></span></h2>

<span style="font-size: 12pt; font-family: 宋体;">点击盒子上的设置，进入<span lang="EN-US">&#8220;</span>网络连接<span lang="EN-US">&#8221;</span>，查看<span lang="EN-US">IP</span>设置，即可获取盒子<span lang="EN-US">IP</span>。如下图（机顶盒上的截图用到<span lang="EN-US">adb</span>的命令包括<span lang="EN-US">adb connect,adb shell screencap,adb pull</span>。具体用法参考文档《机顶盒截图步骤》）：<br /><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/121.PNG" width="543" height="633" alt="" /><br /></span><span style="font-family: 宋体; text-align: center;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 图</span><span lang="EN-US" style="font-family: 宋体; text-align: center;">2 </span><span style="font-family: 宋体; text-align: center;">查询</span><span lang="EN-US" style="font-family: 宋体; text-align: center;">IP</span><span style="font-size: 12pt; font-family: 宋体;"><br /></span>

<span style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast;
mso-bidi-font-family:&quot;Times New Roman&quot;;mso-bidi-theme-font:minor-bidi;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">由上图可以看出本次使用的盒子的<span lang="EN-US">IP</span>为：<span lang="EN-US">192.168.88.104</span>。<br /></span><span style="font-family: 黑体; font-size: 16pt; line-height: 240%;">二、使用</span><span lang="EN-US" style="font-family: 黑体; font-size: 16pt; line-height: 240%;">adb</span><span style="font-family: 黑体; font-size: 16pt; line-height: 240%;">命令安装和卸载软件的步骤<br /></span><span lang="EN-US" style="font-size: 14pt; line-height: 172%; font-family: 黑体;">1</span><span style="font-size: 14pt; line-height: 172%; font-family: 黑体;">、<span lang="EN-US">adb</span>工具安装</span>

<p class="MsoNormal" style="margin-left:21.0pt"><span style="font-size:12.0pt;
font-family:宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;
mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast">方法：把附件中的<span lang="EN-US">adb.exe</span>、<span lang="EN-US">AdbWinApi.dll</span>、<span lang="EN-US">AdbWinUsbApi.dll</span>文件拷贝到<span lang="EN-US">D</span>盘<span lang="EN-US">/adb</span>。（也可拷贝到其他自定义路径，如<span lang="EN-US">D:\Fbox</span>。）<span lang="EN-US"><o:p></o:p></span></span></p>

<span style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast;
mso-bidi-font-family:&quot;Times New Roman&quot;;mso-bidi-theme-font:minor-bidi;
color:red;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:
AR-SA">注：</span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:
minor-fareast;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast;
mso-bidi-font-family:&quot;Times New Roman&quot;;mso-bidi-theme-font:minor-bidi;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">可以设置环境变量（具体见：<span lang="EN-US">Android</span>中<span lang="EN-US">adb</span>环境变量的设置），手动加上<span lang="EN-US">d:\adb</span>，这样就把<span lang="EN-US">adb</span>的使用范围扩大。具体解释如下图的对比：<br /></span><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/3.png" width="565" height="379" alt="" /><br /><span style="font-family: 宋体; text-align: center;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 图3 未设置环境变量时</span><br />  <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;">上图说明adb命令只能在adb应用程序存在的路径中使用，在其他路径下不可以使用。</span><br /><span style="font-size: 12pt; font-family: 宋体;"><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/4.png" width="477" height="347" alt="" /><br /></span><span style="font-family: 宋体; text-align: center;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;图</span><span lang="EN-US" style="font-family: 宋体; text-align: center;">4 </span><span style="font-family: 宋体; text-align: center;">设置环境变量后</span><span style="font-size: 12pt; font-family: 宋体;"><br /></span>

<p class="MsoNormal" style="text-indent:24.0pt"><span style="font-size:12.0pt;
font-family:宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;
mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast">上图是重新配置环境变量后，<span lang="EN-US">adb</span>命令可以随时使用。<br /></span><strong style="text-indent: 0px;"><span lang="EN-US" style="font-size:14.0pt;font-family:黑体">Android</span></strong><strong style="text-indent: 0px;"><span style="font-size:14.0pt;font-family:黑体">中<span lang="EN-US">adb</span>环境变量的设置</span></strong></p>

<span style="font-size: 12pt; font-family: 宋体;">计算机<span lang="EN-US">/</span>属性<span lang="EN-US">/</span>高级系统设置<span lang="EN-US">/</span>环境变量<span lang="EN-US">/</span>系统变量<span lang="EN-US">/Path</span>，在<span lang="EN-US">Path</span>中加上路径：<span lang="EN-US">;D:\adb</span>。注意&#8220;<span lang="EN-US">D&#8221;</span>之前的分号<span lang="EN-US">;</span>。<br /></span><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/5.png" width="420" height="442" alt="" /><br /><span style="font-size:10.5pt;font-family:宋体;Times New Roman&quot;;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 图5 系统属性</span><br /><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/6.png" width="394" height="406" alt="" /><br /><span style="font-size:10.5pt;font-family:宋体;Times New Roman&quot;;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 图6 路径<br /></span><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/7.png" width="357" height="145" alt="" /><br /><span style="font-size: 10.5pt; font-family: 宋体;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;图7 修改路径<br /></span><span style="font-size: 14pt; line-height: 172%; font-family: 黑体;">2</span><span style="font-size: 14pt; line-height: 172%; font-family: 黑体;">、安装apk应用</span><h2><span style="font-family: 宋体; font-size: 12pt;">（1）打开cmd，输入&#8220;d:&#8221;，之后输入&#8220;cd adb&#8221;，进入到应用程序存放的位置。</span></h2><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/8.png" width="405" height="267" alt="" /><br /><span style="font-size:10.5pt;font-family:宋体;Times New Roman&quot;;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;图8 进入adb存放位置</span><br /><p align="left"><span style="font-size: 12.0pt;font-family:宋体;">（2）输入连接机顶盒命令</span></p>  <p style="text-indent:24.0pt;"><span style="font-size:12.0pt;font-family:宋体;">adb connect 192.168.88.104&nbsp;&nbsp;&nbsp;&nbsp; //IP</span><span style="font-size:12.0pt;font-family:宋体;">地址为机顶盒IP</span></p>  <span style="font-size: 12pt; font-family: 微软雅黑, sans-serif;">显示有&#8230;&#8230;connected字样，表示已连接成功。</span><br /><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/9.png" width="493" height="363" alt="" /><br /><span style="font-family: 宋体; text-align: center;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 图9 安装软件</span><br />  <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;">（3）输入安装APK包命令 adb install [apk路径和名称]，其中apk应用可以直接从存储的位置拖拽过来，不用手动敲打路径。我们这里以优酷客户端为安装包。</span><br /><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/10.png" width="493" height="363" alt="" /><br /><span style="font-family: 宋体; text-align: center;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;图10 安装成功</span><br />  <p><span style="font-size:12.0pt;font-family:宋体;">（4）查看应用是否安装成功</span></p>  <p><span style="font-size:12.0pt;font-family:宋体;">&nbsp;&nbsp;&nbsp; </span><span style="font-size:12.0pt; font-family:宋体;">进入&#8220;应用&#8221;中的&#8220;我的应用&#8221;，即可查看。<br /></span></p><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/11.PNG" width="555" height="648" alt="" /><span style="text-align: center;">&nbsp;<br /></span><span style="font-size: 14pt; line-height: 172%; font-family: 黑体;">3</span><span style="font-size: 14pt; line-height: 172%; font-family: 黑体;">、卸载apk应用</span>  <p align="left" style="margin-left: 36pt; text-indent: -36pt;"><span style="font-size:12.0pt;font-family:宋体;">（1）&nbsp;</span><span style="font-size:12.0pt;font-family:宋体;">连接机顶盒</span></p>  <p style="text-indent:21.0pt"><span style="font-size:12.0pt; font-family:宋体;">输入adb connect 192.168.88.104&nbsp;&nbsp;&nbsp;&nbsp; //IP地址为机顶盒IP</span></p>  <p align="left"><span style="font-size: 12.0pt;font-family:宋体;">（2）adb uninstall 包名&nbsp;&nbsp;&nbsp;&nbsp; //包名形如com.android.testme，不包含后缀.apk</span></p>  <p style="margin-left:21.0pt"><span style="font-size:12.0pt; font-family:宋体;">如果不知道包名，可通过以下方法查询：</span></p>  <p style="margin-left:21.0pt"><span style="font-size:12.0pt;font-family:宋体;">1) adb connect 192.168.88.104</span></p>  <p style="margin-left:21.0pt"><span style="font-size:12.0pt;font-family:宋体;">2) adb shell</span></p>  <p style="margin-left:21.0pt"><span style="font-size:12.0pt;font-family:宋体;">3) #cd data/app</span></p>  <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;">4) #ls&nbsp;&nbsp;&nbsp;&nbsp; //</span><span style="font-size: 12.0pt;font-family:宋体;Times New Roman&quot;;">查看包名。</span><br /><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/13.png" width="677" height="442" alt="" /><br /><span style="font-family: 宋体; text-align: center;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 图13 查看安装包</span><br />  <p align="left" style="margin-left: 21pt;"><span style="font-size:12.0pt;font-family:宋体;">其中需要注意的是：</span></p>  <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;">查看有com.youku.tv-1.apk，卸载时如果输入：adb uninstall com.youku.tv-1.apk，则会报Failure错误，正确应该输入：adb uninstallcom.youku.tv，后面的&#8220;-1&#8221;也不用，它不是包名的一部分，而是多次重复安装时Android系统自动加上的。</span><br /><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/14.png" width="461" height="331" alt="" /><br /><span style="font-family: 宋体; text-align: center;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;图14 卸载</span><br />  <p style="text-indent:24.0pt;"><span style="font-size:12.0pt;font-family:宋体;">和安装时一样，可以查看此软件已经被成功卸载。</span></p>  <span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;; color:red;">注：</span><span style="font-size:12.0pt;font-family:宋体;Times New Roman&quot;;">如果在安装软件的过程中，出现了&#8220;系统空间不足&#8221;的信息，可以先查看包名，进行卸载。完成之后，继续安装新软件。</span><br /><img src="http://www.blogjava.net/images/blogjava_net/lijun_li/54475/15.PNG" width="510" height="312" alt="" /><br /><p class="MsoNormal"><span lang="EN-US">&nbsp;</span><span style="font-family: 黑体; font-size: 16pt; line-height: 240%;">三、</span><span lang="EN-US" style="font-family: 黑体; font-size: 16pt; line-height: 240%;">adb</span><span style="font-family: 黑体; font-size: 16pt; line-height: 240%;">工具的相关问题<br /></span><span lang="EN-US" style="font-size: 14pt; line-height: 172%; font-family: 黑体;">1</span><span style="font-size: 14pt; line-height: 172%; font-family: 黑体;">、<span lang="EN-US">apk</span>安装后存放在<span lang="EN-US">Android</span>系统的目录位置为什么是<span lang="EN-US">/data</span>？是否可以自定义？</span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:
minor-fareast">/data </span><span style="font-size:12.0pt;font-family:宋体;
mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:
minor-fareast;mso-hansi-theme-font:minor-fareast">存放的是用户的软件信息（非自带<span lang="EN-US">rom</span>安装的软件）；<span lang="EN-US">/data/app </span>存放用户安装的软件；<span lang="EN-US">/data/data </span>存放所有软件（包括<span lang="EN-US">/system/app </span>和<span lang="EN-US"> /data/app </span>和<span lang="EN-US"> /mnt/asec</span>中装的软件）的一些<span lang="EN-US">lib</span>和<span lang="EN-US">xml</span>文件等数据信息；<span lang="EN-US">/data/dalvik-cache
</span>存放程序的缓存文件，这里的文件都是可以删除的。<span lang="EN-US"><o:p></o:p></span></span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:
minor-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;
mso-hansi-theme-font:minor-fareast">因此，<span lang="EN-US">apk</span>安装后，默认的存放位置时<span lang="EN-US">/data</span>。详细文章参考如下链接：<span lang="EN-US"><o:p></o:p></span></span></p>

<p class="MsoNormal"><span lang="EN-US"><a href="http://www.androidlearner.net/android-directory-apk-install.html"><span style="color:#4472C4;mso-themecolor:accent5">http://www.androidlearner.net/android-directory-apk-install.html</span></a><u><span style="color:#4472C4;mso-themecolor:accent5"><o:p></o:p></span></u></span></p>

<p class="MsoNormal"><span lang="EN-US" style="color:#4472C4;mso-themecolor:accent5">&nbsp;&nbsp;&nbsp; </span><span style="font-size:12.0pt;
font-family:宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;
mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast">利用<span lang="EN-US">adb</span>工具进行软件安装不可以自定义安装位置。安装后的软件只能默认存放在<span lang="EN-US">/data/app</span>中，这里的软件才具有可视性。</span><span lang="EN-US" style="color:#4472C4;mso-themecolor:accent5"><o:p></o:p></span></p>

<h2 style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:
0cm;mso-para-margin-top:.5gd;mso-para-margin-right:0cm;mso-para-margin-bottom:
.5gd;mso-para-margin-left:0cm;line-height:172%"><span lang="EN-US" style="font-size:14.0pt;line-height:172%;font-family:黑体;font-weight:normal;
mso-bidi-font-weight:bold">2</span><span style="font-size:14.0pt;line-height:
172%;font-family:黑体;font-weight:normal;mso-bidi-font-weight:bold">、安装后的文件的权限和占用空间大小如何查看？<span lang="EN-US"><o:p></o:p></span></span></h2>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:
minor-fareast">adb shell<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:
minor-fareast">cd /data/app<o:p></o:p></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:
minor-fareast">ll&nbsp;&nbsp;&nbsp;&nbsp; //</span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:
minor-fareast">查看安装的每一个软件的具体信息，具体包含权限、占用空间等<span lang="EN-US"><o:p></o:p></span></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:
minor-fareast">df&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //</span><span style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:
minor-fareast">检查文件系统的磁盘空间占用情况<span lang="EN-US"><o:p></o:p></span></span></p>

<h2 style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:
0cm;mso-para-margin-top:.5gd;mso-para-margin-right:0cm;mso-para-margin-bottom:
.5gd;mso-para-margin-left:0cm;line-height:172%"><span lang="EN-US" style="font-size:14.0pt;line-height:172%;font-family:黑体;font-weight:normal;
mso-bidi-font-weight:bold">3</span><span style="font-size:14.0pt;line-height:
172%;font-family:黑体;font-weight:normal;mso-bidi-font-weight:bold">、<span lang="EN-US">adb</span>工具的安装和卸载命令参数<span lang="EN-US"><o:p></o:p></span></span></h2>

<p class="MsoNormal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:
minor-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;
mso-hansi-theme-font:minor-fareast">（<span lang="EN-US">1</span>）安装命令<span lang="EN-US"><o:p></o:p></span></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:
minor-fareast">adb install &lt;apk</span><span style="font-size:12.0pt;
font-family:宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;
mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast">文件路径<span lang="EN-US">&gt; </span>：将指定的<span lang="EN-US">apk</span>文件安装到设备上<span lang="EN-US"><br />
</span>　<span lang="EN-US">&nbsp; adb install -s
apk</span>文件名称<span lang="EN-US">.apk </span>：替代内存储器，安装软件到<span lang="EN-US">SD</span>卡上<span lang="EN-US">&nbsp;<br />
</span>　<span lang="EN-US">&nbsp; adb install -r
apk</span>文件名称<span lang="EN-US">.apk </span>：覆盖原来安装的软件并保留之前的数据<span lang="EN-US"><o:p></o:p></span></span></p>

<p class="MsoNormal"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:
minor-fareast;mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;
mso-hansi-theme-font:minor-fareast">（<span lang="EN-US">2</span>）卸载命令<span lang="EN-US"><br />
adb uninstall apk</span>包名<span lang="EN-US">.apk </span>：卸载<span lang="EN-US">apk</span>软件<span lang="EN-US"><o:p></o:p></span></span></p>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0"><span lang="EN-US" style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:
minor-fareast">adb uninstall -k &lt;</span><span style="font-size:12.0pt;
font-family:宋体;mso-ascii-theme-font:minor-fareast;mso-fareast-font-family:宋体;
mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast">软件名<span lang="EN-US">&gt; </span>：卸载软件但是保留配置和缓存文件<span lang="EN-US"><o:p></o:p></span></span></p>

<h2 style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:
0cm;mso-para-margin-top:.5gd;mso-para-margin-right:0cm;mso-para-margin-bottom:
.5gd;mso-para-margin-left:0cm;line-height:172%"><span lang="EN-US" style="font-size:14.0pt;line-height:172%;font-family:黑体;font-weight:normal;
mso-bidi-font-weight:bold">4</span><span style="font-size:14.0pt;line-height:
172%;font-family:黑体;font-weight:normal;mso-bidi-font-weight:bold">、用<span lang="EN-US">adb</span>工具安装和卸载常见问题<span lang="EN-US"><o:p></o:p></span></span></h2>

<p class="MsoNormal" style="text-indent:24.0pt;mso-char-indent-count:2.0"><span style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-font-family:宋体;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:
minor-fareast">问题一：若安装时提示<span lang="EN-US">"error:more than one device and
emulator"</span>，可用&#8220;<span lang="EN-US">adb devices</span>&#8221;查看，应该存在多个<span lang="EN-US">devices</span>，此时可用&#8220;<span lang="EN-US">adb disconnect 172.30.57.86</span>&#8221;命令断开不使用的连接，再用命令&#8220;<span lang="EN-US">adb connect 172.30.<st1:chmetcnv unitname="&#8221;" sourcevalue="57.87" hasspace="False" negative="False" numbertype="1" tcsc="0" w:st="on">57.87<span lang="EN-US"><span lang="EN-US">&#8221;</span></span></st1:chmetcnv><span lang="EN-US">连接，再安装。<o:p></o:p></span></span></span></p>

<span style="font-size:12.0pt;font-family:宋体;mso-ascii-theme-font:minor-fareast;
mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast;
mso-bidi-font-family:&quot;Times New Roman&quot;;mso-bidi-theme-font:minor-bidi;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">&nbsp; &nbsp; 问题二：若执行命令<span lang="EN-US">adb shell</span>报&#8220;<span lang="EN-US">error: protocol fault (no status)</span>&#8221;错误，则可以再执行下连接机顶盒命令，然后再执行<span lang="EN-US">adb shell</span>命令。</span><img src ="http://www.blogjava.net/lijun_li/aggbug/416417.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/lijun_li/" target="_blank">lijun</a> 2014-07-31 18:33 <a href="http://www.blogjava.net/lijun_li/archive/2014/07/31/416417.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>