ADB Push/Pull simple guide - E 2015 General

ADB Push/Pull Simple Guide​To Push a single file from PC to Android, in this case a ROM.zip, you must place the ROM.zip inside the same folder as your ADB and Fastboot files. Right click anywhere inside that folder while holding the shift key down to open the cmd prompt and run these commands:
adb devices
adb push ROM.zip /sdcard​
To Push multiple files at once using a single command do this:
In your SDK/Platform-tools folder, or whever you have your ADB files, create a folder called "tmp"
Place all the files you want to push into the tmp folder then run this command:
adb devices
adb push tmp /sdcard​
--Simple eh?
To Pull a file (In this case a TWRP backup located on the sdcard in a Subfolder of TWRP called BACKUPS) from device to PC or HARDDRIVE.:
Create a folder inside SDKplatform tools or where ever you have your ADB located. I call mine TWRP_Pulls. Inside that folder create a subfolder and give it the name of the backup/File you are pulling. In my case I name the folder by the backups date and numbers.
FOLDER Inside the ADB folder-->TWRP_Pulls
FOLDER Inside TWRP_Pulls-->2016-05-03--17-54-24​The full command would look like this:
adb pull /sdcard/TWRP/BACKUPS/ANDROIDSERIAL/2016-05-03--17-54-24_cm_surnia-userdebug_6.0.1_MHC19Q_bdf9ce04cf C:\Users\Name\Desktop\SDK\platform-tools\TWRP_Pulls\2016-05-03--17-54-24​
(Where ANDROIDSERIAL is your devices serial number and can be found by entering "adb devices")
Make sure you place a space between the first pull and the /sdcard and another one after the ROM.zip and before the <path to location>
adb pull[Space]/sdcard/TWRP/BACKUPS/ANDROIDSERIAL/
2016-05-03--17-54-24_cm_surnia-userdebug_6.0.1_MHC19Q_bdf9ce04cf[SPACE]C:\Users\Name\Desktop\SDK\platform-tools\TWRP_Pulls\2016-05-03--17-54-24​============================================================
CREATED BY: BillyMumphry for educational purposes only. I hope it will help some people as I know I sure fumbled with these Push Pull commands when I was learning.
------------------------------------------------------------------------------------------------------------
* If anyone has any questions or additions fell free to comment or PM or email me:​[email protected]​

Related

how to use adb pull????

Hello Everyone
OK so this is a really newb question but I was confused on the syntax of the adb pull command. I know the syntax is:
adb pull <remote> <local>​I am confused on the remote an local part. Which one of these is the file to copy from the phone and which is the location to put the copied file?
Being that the command says copy files from device that would lead me to think that local would be the file you want to copy and remote is where you want the file to go, but I am not certain.
How do you structure the path to where you want to copy the file to? If it is going to the computer how do you start it, if you want to copy it to the sdcard of the phone how do you start it?
Thanks
dsMA said:
Hello Everyone
OK so this is a really newb question but I was confused on the syntax of the adb pull command. I know the syntax is:
adb pull <remote> <local>​I am confused on the remote an local part. Which one of these is the file to copy from the phone and which is the location to put the copied file?
Being that the command says copy files from device that would lead me to think that local would be the file you want to copy and remote is where you want the file to go, but I am not certain.
How do you structure the path to where you want to copy the file to? If it is going to the computer how do you start it, if you want to copy it to the sdcard of the phone how do you start it?
Thanks
Click to expand...
Click to collapse
If your using Mac OS you can use my app to do it
Anyway, remote is the device. Local is the computer. so it could be like ./adb pull /sdcard/img.jpg /user/you/desktop/
Edit: just re-read your post.
Are you saying you want to push files to the device???
that would be ./adb push (file on computer) location on device (i.e. /sdcard/ or /system/app, etc)

EASIEST sdk adb guide tutorial instructions

I have learned alot from this site so i figured i'd give something back. these are the the two easiest methods i have found for setting up the android debug bridge. one for windows and one for linux... these instructions should work for any version of windows.
first make sure you download the latest sdk by going to android.com and clicking on developers.
windows:
after you have download the sdk, unzip it to your desktop. rename it to sdk. cut the UNzipped folder on the desktop that you just renamed by right clicking and hitting "cut" then go to start>my computer>c: and paste the folder here. now go into the new "sdk" folder and right click on the "tools" folder and click "send to" then choose "desktop (as shortcut)" you should now have a shortcut on the desktop called "tools-shortcut"
now for the easy part: hold shift and right click on tools-shorcut, holding shift adds the option "open command window here" to the context menu that comes up so click on that. now just make sure your phone is connected to the computer and on ur phone debugging is enabled (menu>applications>development>debugging). on ur command window that came up you should see a black box with white text and the cmd should be c:\sdk\tools> just type "adb devices" and you should see your phone under "list of devices attached" if you do see it you should be able to start running adb commands
adb pull "/location to file or folder on phone" -(the pulled folder or file will be in the tools folder we created earlier which you can still access by clicking on the tools-shortcut on your desktop)
adb push "name of file or folder to be placed on the phone sdcard" -(make sure the file or folder you wish to place on the phone has been placed in the "tools" folder on the computer, again its the same folder the "tools-shortcut" opens up)
hint and examples: i have found a good way to back up and reinstall all ur apps using just adb push and pull. just experimenting and playing around with it i have found you can accomplish installing with just knowing these commands above... if you plan to data wipe and flash a new rom but you don't want to go through the tedious task of reinstalling and you have a rooted android phone then you may use this method to backup/reinstall ALL of your apps. plus this will give you good practice using adb.
backup example:
adb pull /data/app .... let it finish
adb pull /data/app-private ...let it finish
now you should have ALL of ur apps in ur tools folder on ur computer! in the tools folder, create a new folder and name it what u want, i named mine APPS4EVO because i have an evo and and epic and some apps don't work for both so i keep them seperate. cut and paste all of ur apps and put them into your newly made folder. now back to the adb window
restore example:
adb push /APPS4EVO /data/app/
this will push all of your apps in your backed up folder you made earlier to the folder where apps go when they are installed and if you wait 1-10 minutes depending on how many apps you have you should be able to see them on ur phone as if you had installed them one by one. also notice the space between /APPS4EVO and /data/app/ the space seperates the folder from inside ur tools folder you wish to install and the location you wish to put them on ur phone. please be aware that you do not need to type c:\sdk\tools\APPS4EVO because the command window is already being ran in the tools folder, so the location would just be /APPS4EVO in my case.
adb shell -opens up the terminal shell to run commands specifically for the phone, while in the shell you cannot run other "adb xxxxx" commands, you will have to exit the shell by typing "exit"
OPTIONAL: i marked this as optional bc with the above it is not necessary... i have never done this and my adb works great but i have seen it often in other tutorials around the web.... i believe its only necessary on windows 7 and maybe vista. go to start then right click on "my computer" and click on "properties" then in the left pane click on "advanced system settings" then in the window that pops up click on "environment varables" button, in the next window that pops up, under "system variables" scroll down to the "path" variable and double click it. in the "variable value" box do NOT erase anything but add ";c:\sdk\tools" (without quotations). then click ok on all the windows cuz ur done.
thats all for windows.
linux (ubuntu)
extract the sdk to your home/name/ folder and rename it to sdk. now right click on the folder and go to permissions and make sure (run as executable) is checked, now go into the folder and do the same permission change to the tools directory.
now you should be able to run adb commands in the terminal when your phone is connected. same as in windows except your commands will be preceded by your tools folder location....
FOR EXAMPLE:
/home/jay/sdk/tools/adb devices
/home/jay/sdk/tools/adb push xxxx xxx
/home/jay/sdk/tools/adb pull xxxx
EXTRA:
if your having troubles connecting ur phone to ur computer over usb, even after installing drivers, like i sometimes have with my epic, you can download "wireless adb" from the market which i found to be surprisingly easy to use, just like if u were connected by usb, except under adb devices you will show up as your gateway address not ur device name but trust it still works the same.
good luck everyone, i hope this post isn't redundant and i really hope i help someone out there just starting! adb is confusing at first.

i managed to pull the nandroid. now i need to push it back.

so i had a thread about getting these files pulled off of my buddies busted n4. but the adb command given wouldnt work and i didnt figure out how to make a tarball untill after i pulled the files. anyways...
i managed to pull the nandroid using this command - adb pull /sdcard/clockworkmod/backup/2013-08-07.23.11.28/.
what i ended up with were all of the files separately on my pc.
so if i put all of the files back into its own folder with the same name on my pc, what would be the command to push it back onto the new phone that i am about to root. using cwm.
assuming i kept the folder in platform tools. C:\androiddev\sdk\platform-tools
and do i need to create directory in the phone first? .../clockworkmod/backup/2013-08-07.23.11.28
it seems like i remember these commands, or at least i could figure it out by the commands listed, in one of the original root unlock stickies. but they seem to have been replaced with one click dealios. i need to start using adb for all of my flashing and such just so i can stop looking like an idiot for not knowing the simple stuff. in other words i would experiment and figure it out.... but i am afraid that i will just litter his phone with files and still end up coming back here.
thank you.
A quick guide to the adb pull and adb push commands:
Code:
adb pull <remote> <local>
adb push <local> <remote>
Remote being folder location on phone, local being folder location on computer.
So the correct command to pull the backup and put it into a folder under platform-tools (let's use the folder name you are using) would be this:
Code:
adb pull /sdcard/clockworkmod/backup/2013-08-07.23.11.28/ 2013-08-07.23.11.28
All you have to do to put it into it's own folder is put a space after the remote location and type whatever name you want the folder to be.
Now on to your current question. You said you pulled the files onto the computer, but they weren't in their own folder. I would put them into their own folder (we'll use 2013-08-07.23.11.28 for now) and push the contents of that folder to a folder on your phone, that we will also call 2013-08-07.23.11.28 under the backup location (If you want to make sure you have only the files contained in the backup, try re-pulling them using the above pull command. If you're pretty sure you know which ones it pulled, I wouldn't worry about it). Try this:
Code:
adb push 2013-08-07.23.11.28 /mnt/shell/emulated/clockworkmod/backup/2013-08-07.23.11.28/
That'll push the contents of folder 2013-08-07.23.11.28 under platform-tools and put them in a folder called 2013-08-07.23.11.28 under /backup/. If it doesn't exist, it'll create the folder. Now you pulled the backups by using /sdcard/, I didn't know you could just do that, so I guess you could try pushing using that too:
Code:
adb push 2013-08-07.23.11.28 /sdcard/clockworkmod/backup/2013-08-07.23.11.28/
I'm pretty sure those should do the trick. Let me know if that helped.
Johmama said:
A quick guide to the adb pull and adb push commands:
Code:
adb pull <remote> <local>
adb push <local> <remote>
Remote being folder location on phone, local being folder location on computer.
So the correct command to pull the backup and put it into a folder under platform-tools (let's use the folder name you are using) would be this:
Code:
adb pull /sdcard/clockworkmod/backup/2013-08-07.23.11.28/ 2013-08-07.23.11.28
All you have to do to put it into it's own folder is put a space after the remote location and type whatever name you want the folder to be.
Now on to your current question. You said you pulled the files onto the computer, but they weren't in their own folder. I would put them into their own folder (we'll use 2013-08-07.23.11.28 for now) and push the contents of that folder to a folder on your phone, that we will also call 2013-08-07.23.11.28 under the backup location (If you want to make sure you have only the files contained in the backup, try re-pulling them using the above pull command. If you're pretty sure you know which ones it pulled, I wouldn't worry about it). Try this:
Code:
adb push 2013-08-07.23.11.28 /mnt/shell/emulated/clockworkmod/backup/2013-08-07.23.11.28/
That'll push the contents of folder 2013-08-07.23.11.28 under platform-tools and put them in a folder called 2013-08-07.23.11.28 under /backup/. If it doesn't exist, it'll create the folder. Now you pulled the backups by using /sdcard/, I didn't know you could just do that, so I guess you could try pushing using that too:
Code:
adb push 2013-08-07.23.11.28 /sdcard/clockworkmod/backup/2013-08-07.23.11.28/
I'm pretty sure those should do the trick. Let me know if that helped.
Click to expand...
Click to collapse
thanks a ton. it worked. i tried the first option. rebooted recovery. and it could not find the files. i rebooted the phone. and then went back into recovery. the files still were not there.
so then i did the second option. with the sdcard. it worked like a charm. his phone is back to aug 7th. and didnt lose a thing... other than the last four days of his new data.
phermey said:
thanks a ton. it worked. i tried the first option. rebooted recovery. and it could not find the files. i rebooted the phone. and then went back into recovery. the files still were not there.
so then i did the second option. with the sdcard. it worked like a charm. his phone is back to aug 7th. and didnt lose a thing... other than the last four days of his new data.
Click to expand...
Click to collapse
Well that's odd, I'm the exact opposite, I can't see the files in /sdcard/, only the path through /mnt/. I'm not too familiar with how the Nexus 4 handles the emulated sdcard, I just never had the reason to explore it.
Actually, I think the difference between where our recoveries saw the backups is because of a version difference. CWM has changed their backup location in the past, and I'm sure you are using a version that is looking for backups in the /sdcard/ directory, while mine was looking for them through /mnt/.
EDIT:
Oh btw, you might advise your friend to download a file explorer app (I use ES File Explorer) and erase those backups that he didn't use in the /mnt/ folder. I'm sure they are still there taking up space on his phone. You may or may not need root to see the correct folder though.

[Q] adb push problem

Hi
Brand new to the forum so not sure if this is the right place for this question.
I am trying to load the D2XX libftd2xx drivers from a windows 7 command prompt via this adb command:
adb push D2XX/libftd2xx-jni.so /data/data/com.ftdi.d2xx/libftd2xx-jni.so
I am launching adb fro within the tools folder, (shift right click etc)
The file libftd2xx-jni.so is within the D2XX folder which is within the tools folder (same as ADB).
I have tried various combinations of the above path name , even a full C:\ path with no success.
I keep getting this error message: Failed to copy 'D2XX/libftd2xx-jni.so' to '/data/data/com.ftdi.d2xx/libftd2xx-jni.so' : No such file or directory
Not sure what the problem is. Phone is NOT rooted so may be a permissions issue although I would expect to see a 'permission denied' sort of message?

[Tutorial] copy files to android from windows and the other way for locked phones

hi.
so we now have android in windows phone.there's a tutorial on how to copy files from that android and to that android os but i think you're phone needs to be unlocked (interop).and if you're phone is locked you can do it (i've been away from these kind of things for a long time.correct me if i'm wrong)
i used adb before and knew there was some kind of command to check the folders and files in the phone.so i took my chances and i tried them.
here is the code:
1-
Code:
adb shell
2-result will be something like
Code:
/system/bin/sh: No controlling tty: open /dev/tty: No such file or directory
/system/bin/sh: warning: won't have full job control
[email protected]:/ $
3-type this
Code:
ls
it will gives you a list of all folders in the phone (in android os in windows phone in this case)
4-the main folder is "mnt" so type this code
Code:
cd mnt
5- you can still type
Code:
ls
but it'll take a lot of times to find folders so i'll just give it to you guys.these are the command you need to enter and press enter.(each line must be typed separately)
Code:
cd shell
Code:
cd emulated
Code:
cd 0
6-in here is you type
Code:
ls
you can see that you have Pictured,Music and things like this.so if you want to create a folder in your android just type
Code:
mkdir YourFolder
7-after you created your folder enter
Code:
exit
to exit the shell and now you can "push" and "pull" commands.here's how push command work
Code:
adb push Path\To\Your\File.txt mnt\shell\emulated\0\YourFolder
i like to put my files that i want to push in the same folder that i have adb.exe so i just need to type the file name and extension.
8-after that you can install an android file manager to manage your files.
i haven't tested "pull" command but it'll work.i just need to test it.
so sorry if you guys knew this method , i just wanted to share it with you.
this method is really good for phone like 920 and for apps and games that has .obb data files (like Fallout Shelter )
Really appreciate you for this tutorial and helping nature,but we had a ""shortcut ""way using file Explorer
http://forum.xda-developers.com/win...utorial-how-to-copy-files-android-to-t3178808

Categories

Resources