七月网

adbpush(adb push命令)

七月网1790

一、ADB放文件和取文件\adb push 、 adb pull

adb push命令:从电脑上传送文件到手机;

adbpush(adb push命令)

adb pull命令:从手机传送文件到电脑上;

1.首先使用Usb连接电脑与小机,然后安装adb相应的驱动;

3.输入命令adb remount,意思是将设备改为可读可写;

显示remount succeeded就代表命令执行成功;

4.假如你要将Windows下D盘根目录下的file.txt文件拷贝到机器(手机或者平板)的/system/目录下;可以使用命令如下:

adb push D:\file.txt system/

执行成功后就会机器的system/目录下就会有file.txt文件存在了。

5.假如你要将机器(手机或者平板)的/system/目录下的file.txt文件拷贝到Windows下D盘根目录下;

这样就可以file.txt文件复制到D盘根目录下了。

注意:你在运行adb push这条命令时,可能会遇到failed to copy'D:\file.xtxt' to'/system/': Read-only file system的报错信息,这是由于你没执行adb remount命令或者执行这条命令没成功;

二、关于使用adb将文件push入android手机并覆盖的问题

首先使用Usb连接电脑与小机,然后安装adb相应的驱动,这是第一步,也是必须要做的。进入doc系统后,敲入adb shell可以进入linux命令行状态,说明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上复制一份文件到计算机上。

C:\Documents and Settings\Michael\My Documents\My Pictures>mksdcard 512M mycard

C:\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文件

可以将真机上的一个具体文件拷贝到PC上,也甚至可以将一整个文件夹都拷贝到PC上;如:

1.adb pull/sdcard/mine.jpg~/Desktop/#将sdcard中的一个mine.jpg拷贝到PC的桌面上。

2.adb pull/sdcard/download~/Desktop/#将sdcard中的download文件整个拷贝到PC的桌面上。

三、用adb push命令怎么向手机中传送文件夹,必

首先使用Usb连接电脑与小机,然后安装adb相应的驱动,这是第一步,也是必须要做的。进入doc系统后,敲入adb shell可以进入linux命令行状态,说明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上复制一份文件到计算机上。

C:\Documents and Settings\Michael\My Documents\My Pictures>mksdcard 512M mycard

C:\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文件

可以将真机上的一个具体文件拷贝到PC上,也甚至可以将一整个文件夹都拷贝到PC上;如:

1.adb pull/sdcard/mine.jpg~/Desktop/#将sdcard中的一个mine.jpg拷贝到PC的桌面上。

2.adb pull/sdcard/download~/Desktop/#将sdcard中的download文件整个拷贝到PC的桌面上。

OK,本文到此结束,希望对大家有所帮助。