If you are a tech-savvy Android user, you may have heard of ADB and Fastboot. the two most popular utilities from the Android SDK Platform Tools package. These are two command-line tools that allow you to communicate with your Android device from your computer. You can use them to perform various tasks, such as installing apps, flashing firmware, unlocking the bootloader, and more.
One of the most common uses of ADB and Fastboot is to transfer files between your computer and your Android device. This can be useful when you want to backup your data, sideload an update, or copy some media files. In this article, we will show you how to transfer files to Android with ADB or Fastboot.
Why use ADB or Fastboot to Transfer Files?
In tricky situations, ADB always come in handy. ADB is a utility that is maintained by Google and is intended for development purposes. Fortunately, this utility can be utilized to access devices that have otherwise faulty MTP (Media Transfer Protocol) drivers or other issues when transferring files normally.
There are many scenarios when Android USB and MTP drivers fail to load, so this is where the Android SDK Platform Tools come in that can help get out of this tricky situation. ADB and Fastboot are very versatile tools with a lot of options but for our purposes, we will only use ADB’s push and pull commands, along with Fastboot’s flash command to transfer files. Further, this procedure can also be utilized when a device is booted into recovery mode.
What You Need
Before you can transfer files to Android with ADB or Fastboot, you need to have some prerequisites:
- A Windows, Mac, or Linux computer with ADB and Fastboot installed. You can download the latest version of the SDK Platform Tools package here.
- An Android device with USB debugging enabled. To enable USB debugging, go to Settings > About phone > Tap on Build number seven times > Go back to Settings > System > Developer options > Enable USB debugging.
- A USB cable to connect your Android device to your computer.
How to Transfer Files to and from Android with ADB
ADB stands for Android Debug Bridge. It is a tool that lets you execute commands on your Android device from your computer. You can use ADB to transfer files to Android in two ways: push and pull. For more information, you can go through this ADB commands list for examples and references.
Transfer Files to Android with ADB Push Command
The push command lets you copy files from your computer to your Android device. The syntax of the push command is:
adb push <source> <destination>
The source is the path of the file or folder on your computer that you want to copy. The destination is the path of the file or folder on your Android device where you want to copy it.
For example, if you want to copy a file named test.txt
from your desktop to the Downloads
folder on your Android device, you would use this command:
adb push C:\Users\YourName\Desktop\test.txt /sdcard/Download
You can also use wildcards (*) to copy multiple files or folders at once. For example, if you want to copy all the files and folders from your desktop to the Downloads
folder on your Android device, you would use this command:
adb push C:\Users\YourName\Desktop\* /sdcard/Download
Transfer Files from Android with ADB Pull Command
The pull command lets you copy files from your Android device to your computer. The syntax of the pull command is:
adb pull <source> <destination>
The source is the path of the file or folder on your Android device that you want to copy. The destination is the path of the file or folder on your computer where you want to copy it.
For example, if you want to copy a file named photo.jpg
from the Pictures
folder on your Android device to your desktop, you would use this command:
adb pull /sdcard/Pictures/photo.jpg C:\Users\YourName\Desktop
You can also use wildcards (*) to copy multiple files or folders at once. For example, if you want to copy all the files and folders from the Pictures
folder on your Android device to your desktop, you would use this command:
adb pull /sdcard/Pictures/* C:\Users\YourName\Desktop
How to Transfer Files to Android with Fastboot
Fastboot stands for Fastboot Mode. It is a mode that lets you flash firmware and partitions on your Android device from your computer. You can use the Fastboot tool to transfer files to Android with this command: flash.
Transfer Files to Android with Fastboot Flash Command
The flash command lets you write a file or an image to a specific partition on your Android device. The syntax of the flash command is:
fastboot flash <partition> <file>
The partition is the name of the partition on your Android device that you want to write to. The file is the path of the file or image on your computer that you want to write.
For example, if you want to flash a custom recovery image named twrp.img
to the recovery
partition on your Android device, you would use this command:
fastboot flash recovery twrp.img
You can also use wildcards (*) to flash multiple files or images at once. For example, if you want to flash all the images in a folder named images
on your desktop to their corresponding partitions on your Android device, you would use this command:
fastboot flash * C:\Users\YourName\Desktop\images\*
In this article, we have shown you how to transfer files to Android with ADB or Fastboot. These are two powerful tools that can help you manage your Android device from your computer. However, they also come with some risks, such as wiping your data or bricking your device. Therefore, you should always be careful when using them and follow the instructions carefully.