adb.exe:Android Debug Bridge,安卓调试桥;
要想直接在DOS命令行中使用 adb,需要配置环境变量;
1、adb kill-server:杀死adb服务;杀死之后,eclipse 会自动尝试重新连接;
控制台信息:Adb connection Error:远程主机强迫关闭了一个现有的连接。
杀死 adb 服务后,会自动尝试重新连接。
2、adb start-server:开启adb服务;
3、adb install helloworld.apk:快速安装apk文件;要知道 apk 的路径;
4、adb uninstall com.example.helloworld:快速卸载一个应用程序(注意:卸载后面加的是包名,可在 DDMS 中查看包名);
5、adb shell:进入手机终端命令行界面(和linux命令终端一样);
# ls:查看系统中所有的目录的指令;
# cd mnt/sdcard:进入 sd 卡的指令;
退出命令终端界面:ctrl + c
6、adb push d:\test.txt /mnt/sdcard 将D盘根目录下的 test.txt 文件发送到手机的 /mnt/sdcard 目录下;
7、adb pull /mnt/sdcard/test.txt e:\ 将手机上 /mnt/sdcard 目录下的 test.txt 发送到E盘根目录下;
8、adb pull /mnt/sdcard e:\ 将 /mnt/sdcard 目录下的所有文件都发送到E盘根目录下;