[HOWTO][ADB]Emergency Situations when file transfer is necessary

Search This thread

corphish

Recognized Dev / Inactive Recognized Contributor
Apr 16, 2014
1,019
2,462
Durgapur
Introduction :
We all know how to copy files from PC to Android Device and vice-versa (I guess :p)
But say, in some rarest of situations, where your phone is being recognized by PC on connection with USB cable, but for some reason, 'My Computer' or whatever File Explorer does not show your device, or doesn't lists files and directories of your phone, and you would want to transfer files, then this guide is for you.

I would have put the title, the one written below, but it won't fit in the Title :D
Transfer files from your PC to phone and vice-versa even if 'My Computer' does not recognize your phone properly.
However, PC must recognize it (when a notification sound is played on connection).

Requirements :
1. You :p
2. An Android Device.
3. A PC. (I will use windows 8 in this guide)
4. ADB installed on your PC and configured for your phone.

Procedure:

Let this be the situation

10714112_400529516776331_2633018482494652173_o.jpg


As you can see, My Computer says 'This folder is empty', but actually I have 2 main folders , sdcard0 and sdcard1

10440682_400530693442880_8997812461746731409_n.jpg


Now what you have to do is open ADB. To do that, Hold Shift+Right click on your ADB folder and then select 'Open Command Prompt window here'

10749950_400532696776013_9151983362472124361_o.jpg


First we will check whether ADB recognizes the Device, to do that, type :

Code:
adb devices

10836465_400534330109183_1178500332_n.jpg


If your device is recognized, the result will be

10171154_400534906775792_7349430236606387708_n.jpg


If it does not recognize, nothing will show up in the list.
Now, the main thing, to transfer file, I will be transfering 'Gallery.apk' to my sdcard0 main directory.
I have kept the Gallery.apk in C:\ for easy address.
Now the general format of the code:

Code:
adb push <source address> <destination address>
Source address here is C:\ and target address is storage/sdcard0/
You can check for address of a location on your Phone by always viewing properties with a file explorer of a folder or a file.
So I type :
Code:
adb push C:\Gallery.apk storage/sdcard0/
First, before executing it, I will show no Gallery.apk is present in referred directory

961451_400537570108859_97473364_n.jpg


After typing the code, it should look like this :

10841316_400539280108688_1409874923_n.jpg


Execute it.
On successful execution, it will look like


10833970_400539863441963_2081055868_n.jpg


You can do the same thing to transfer files from Phone to PC
Code would be :

Code:
adb pull <source address> <destination address>
Remember, here source address will be the address of file present in your phone and destination address would be the desired location you would want to put the file in.

This should work even if your phone is not showed up in My Computer at all, but however PC detects it and so does adb.
Transferring multiple files will really be painful, but wait, trick is even here too.
Just press the up arrow key in command prompt and the last statement would appear, now just change address and your hard work is reduced to just work :D.


Cases when this won't work -
1. ADB is not configured. Head over to this thread to set up ADB. You can Google it more info.
2. ROM installed on your phone has storage issues (like mount problems).

If you feel this guide has helped, then there is no harm in pressing Thanks button :D