How to Copy a File from the Computer to Android with ADB Push?

ADB Push to Copy Files Folder

Most people will let their PC mount the smartphone automatically and then switch over to MTP mode (aka file transfer mode) to access files on the device. This isn’t possible in Android’s special boot modes though so let me show you how you can send files from your computer to your Android smartphone or tablet device with ADB.

If you’re looking to copy a file from the smartphone to the PC then refer to this tutorial instead.

Setting a device to MTP mode in order to copy something to or from it is definitely the easiest route, but sometimes it simply isn’t an option. A great example of this is when we are currently booted into TWRP and have done something like formatted the /data partition. Once that is done, any custom ROM file that we had stored there is gone and we need to use ADB Push in order to copy the ZIP file back onto the device we are currently working on.

How to Use ADB Push to Copy a File to Android?

Connect the smartphone or tablet to the PC with a USB cable

Make sure whatever you want to copy is already in your ADB & Fastboot tools folder

Launch a Command Prompt, Terminal, or Windows PowerShell from within your ADB & Fastboot tools folder

Type out the following command. . .

adb push <local file> <remote location>

You’ll be replacing <local file> with the name of the file you want to copy, and replace <remote location> with the directory within Android’s internal storage that you want the file to be copied to.

. . .and press Enter on the keyboard

Wait for the file to be copied from the PC to your Android device

Then disconnect the USB cable

Note: Be sure that you remove any spaces from the name of whatever file you’re wanting to copy to Android. You can copy files that include a space in the filename, but you will have to wrap quotation marks around the filename (or entire file path) for the command to work. It’s usually just easier to remove spaces in the filename, though.

The step by step instructions may seem a bit confusing a first so it’s recommended that you follow along with me in the video above. Again, if you’re already booted into the Android OS then you don’t really need to go through any of this to copy a file to your Android smartphone or tablet.

Instead, you can switch the USB mode (check your Notification Panel after completing Step #1 of the tutorial) over to MTP or File Transfer mode. You can then just copy the file through your desktop OS’ file explorer program like you are used to. I have a feeling you’re here because you either prefer the command line or aren’t booted into the Android OS.

Example Command with Correct Syntax

I go over an example in the video above but I understand that not everyone wants to watch that. So here I will go over what I mean when I tell you to type out the command adb push <local file> <remote location>. The “adb push” part of the command is very straight forward and is simply telling ADB.exe that we’re about to “push” (e.g. send, or copy) a file to an Android device over USB.

adb push Magisk-uninstaller-20170813.zip /sdcard

So this is the example command we’re looking at here. We’re telling the ADB.exe file to “push” this Magisk uninstaller ZIP file into a folder on the Android smartphone or tablet labeled “sdcard.” This may be even more confusing to those who don’t have an “SD card slot,” but this is actually just where Android mounts the internal storage.

For instance, you’re likely familiar with the Downloads folder which is in Android’s internal storage. This is actually located in /sdcard/Download/

What we’re doing with this example command is using ADB to send the Magisk Uninstaller ZIP file to the “base” directory of your internal storage. If you wanted, you could even replace /sdcard with /sdcard/Download and that would copy the ZIP file to the commonly used Downloads folder.

showing the adb push command to copy files
You will most likely want to copy the file to either /sdcard or /sdcard/Download with ADB Push.

Remember, this is just an example scenario here and you can replace this Magisk uninstaller file with any other file you have stored on your PC. I advise that you move or copy that file to where ever your ADB and Fastboot folder is so that you can just type out the filename after the adb push part of the command.

That isn’t required though and you can choose to type out the full file path instead of just the filename. In that situation, the command would look something like this. . .

adb push E:\Downloads\Magisk-uninstaller-20170813.zip /sdcard

Not everyone is familiar with the full file path structure on PCs though so this is something I avoid trying to recommend as well. However, if you’re still wanting to avoid putting files in your ADB & Fastboot folder then you can choose to drag and drop the file into the Command Prompt or Windows PowerShell (I haven’t tested this on macOS or Linux).

If you’re still confused about all of this, go in and experiment to see how the command works for you. I don’t see how you could break anything as you’ll just see an error in the Command Prompt or PowerShell if you typed something wrong. And you can’t use ADB Push to copy a file in a folder that will break something, so you can’t lose any of your data by experimenting either.

Can I Push an Entire Folder with ADB Push?

I see this question come up quite often within the Android community so I wanted to make sure I answered it here. Yes, you can easily copy an entire folder to your Android smartphone or tablet with this same command. The command itself will need to be modified a bit, but it is still possible.

Let’s see how that would look. . .

adb push E:\Files\magisk /sdcard/Download/magisk

We can break this command down as us having a folder on our PC with the file path of e:\Files\magisk and in that “magisk” folder we can have any number of files and/or folders. Everything in that folder will be “pushed” (e.g. transferred, copied) into a “magisk” folder within the Downloads directory on our smartphone or tablet.

Experiencing difficulties with your Device, check out our “How To” page on how to resolve some of these issues.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

How to Boot the OnePlus 7 and OnePlus 7 Pro into Recovery Mode

Next Post

How to Run Android Apps on Chrome and Chrome OS

Related Posts