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.
In order to complete the tutorial below, you're going to need some things set up ahead of time. Please follow the how to install ADB and Fastboot tools guide if you haven't done so already. Then you will need to follow this guide: How to Enable Developer Mode, as well as this one which shows you How to Enable USB Debugging Mode.
You will then need to open a command prompt within the same folder as your ADB and Fastboot tools and execute the "adb devices" command (without quotes) to start the ADB service. From here, you can connect the device to the PC with a USB cable. If everything has been done properly then you'll be asked if you want to grant USB Debugging Mode access from the PC the phone is connected to.
Once granted, you can then test this by running the command "adb devices" again (without quotes) in a Command Prompt, Terminal, or Windows PowerShell to make sure the computer recognizes the device. If your PC is not detecting the device using these methods then you are likely having USB driver-related issues. It is then advised to download and install the ADB driver released by the OEM.
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
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/Download and that would copy the ZIP file to the commonly used Downloads folder.
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.
If this tutorial helped you, please consider supporting the website in any number of ways. Even if you are unable to donate, sharing my websites (AndroidExplained.com & PlayStoreSales.com) on social networks helps a lot, sharing or liking content on Facebook, subscribing on YouTube and liking videos, etc. It all helps in more ways than one.
If you run into any issues with this guide though, please leave a comment to let me know. This will help me to keep content as up to date as possible.