
首先使用USB连接电脑与小机,然后安装adb相应的驱动,这是第一步,也是必须要做的。进入doc系统后,敲入adb shell 可以进入linux命令行状态,说明adb可以使用了。1.adb介绍adb pull <remote><local> Copies a specified file from an emulator/device instance to your development computer.adb push <local><remote> Copies a specified file from your development computer to an emulator/device instance.adb pull 就是从真机上拷贝
文件到PC上。adb push 就是从PC上复制一份文件到计算机上。2.adb pull 用法:以下用模拟器,真机用法类似。C:\Documents and Settings\Michael\My Documents\My Pictures>mksdcard 512M mycardC:\Documents and Settings\Michael\My Documents\My Pictures>adb push luan.jpg mycard failed to copy 'luan.jpg' to 'mycard': Read-only file system C:\Documents and Settings\Michael\My Documents\My Pictures>adb push luan.jpg /sdcard failed to copy 'luan.jpg' to '/sdcard': Is a directory C:\Documents and Settings\Michael\My Documents\My Pictures>adb push luan.jpg /sdcard/sdcard 128 KB/s (12383 bytes in 0.093s) #/sdcard下会生成一个sdcard文件 C:\Documents and Settings\Michael\My Documents\My Pictures>adb push luan.jpg /sdcard/ 42 KB/s (12383 bytes in 0.281s) #/sdcard下会生成一个luan.jpg文件 C:\Documents and Settings\Michael\My Documents\My Pictures>adb push luan.jpg /sdcard/luan.jpg 55 KB/s (12383 bytes in 0.218s) #/sdcard下会生成一个luan.jpg文件3.adb push 用法可以将真机上的一个具体文件拷贝到PC上,也甚至可以将一整个文件夹都拷贝到PC上;如:1.adb pull /sdcard/mine.jpg ~/Desktop/ #将sdcard中的一个mine.jpg 拷贝到PC的桌面上。2.adb pull /sdcard/download ~/Desktop/# 将sdcard中的download 文件整个拷贝到PC的桌面上。.Linux下
目录复制:本机->远程
服务器scp -r /home/shaoxiaohu/test1 zhidao@192.168.0.1:/home/test2
#test1为源目录,test2为目标目录,zhidao@192.168.0.1为远程服务器的用户名和ip地址。
Linux下目录复制:远程服务器->本机
scp -r zhidao@192.168.0.1:/home/test2 /home/shaoxiaohu/test1
#zhidao@192.168.0.1为远程服务器的用户名和ip地址,test1为源目录,test2为目标目录。
注:如果端口号有更改,需在scp 后输入:-P 端口号 (注意是大写,ssh的命令中 -p是小写)
评论列表(0条)