An advanced Android user always wants to minimize the work during the development process so that more focus can be beamed onto the target. During the development of a ROM or a Mod, many tiny operations like retrieving files from the device, flashing the mods, restore the backups if the device is bricked and so on. These tiny operations consume a major chunk of time during this process, and one most important operation is the pushing and pulling files from the Android device.
Transferring the Apk’s and other files in and out using the normal process where you need to transfer the files using a USB cable and then using the root explorer to copy it to the system partition and then assigning permissions is a lengthy and tiresome process. Even if you make flashable Zips which can be flashed using recovery, you need to reboot to recovery every time you want to try the modification. However, the ADB mode of transferring files using the Push and Pull commands are one of the best alternatives you’ll get.
How to Manage Android Devices with Wonershare MobileGo (transfer file, manage app, boost speed, and clean up junk files)
Using the ADB tool, you can push and pull files with simple commands, so you don’t even need to touch your device while trying your mods. Today, we will show you how to push and pull files on Android device using the ADB commands.
Prepare Your Device
- Charge your device above 60% battery level to avoid shutdowns during the process.
- Install proper device drivers on your PC and check if the device is detected. You can find the drivers for your device from our driver downloads page → Click Here
- Enable USB Debugging on your phone from Settings> Developer options. If you do not find Developer option under device settings, read the instructions given here.
- Either setup ADB and Fastboot on your computer, or download the Minimal Fastboot/ADB tool and unzip it: mfastboot-v2.zip
Push and Pull Files Using ADB Commands
- Download and extract the ADB files on your PC.
- Open a command prompt in the ADB folder by right clicking on the mouse in the empty space of the folder while holding the Shift key.
- Now to pull any file from your device, you need to know its path. Once you know the path of the file, enter the following command to pull the file.
adb pull <path-of-the-file>
For instance, let’s pull the Settings.apk which is located in the /System/app/ folder on your device.
adb pull /system/app/Settings.apk
- The file will be pulled and saved in the ADB folder itself and you can see the transfer rate in the command prompt.
- Pulling any file from the device is easy but pushing files to the device needs permissions. You can push any file to the internal or external SD card without any issue, but when you’re pushing it to the System partitions you might get this error:
- So you need to mount the file system as Read-Write rather than Read-only, so execute the following commands one-by-one to mount the system writable:
adb shell su mount -o remount,rw /system
- Your device might prompt for root permissions when you type SU, grant them. You will get the following output if everything went right.:
- Once you are done making changes, you should remount with the original Read-Only.
mount -o remount,ro /system
- To push a file to the device, just type the following command:
adb push <source-path> <target-path>
adb push Settings.apk /system/apps/
- If the file is pushed correctly to your device, you’ll get the similar output on the command prompt:
So you now know how to push and pull files using the ADB commands. These commands are important yet simple, aren’t they?
Leave your feedback in the comments section below.