126

Trying to copy file from device to desktop, here is a command:

adb pull sdcard/log.txt Users/admin/Desktop

But this command creates a folder Users/admin/Desktop inside platform-tools folder where adb is located. How to pull file to my desktop ?

6 Answers 6

154

Use a fully-qualified path to the desktop (e.g., /home/mmurphy/Desktop).

Example: adb pull sdcard/log.txt /home/mmurphy/Desktop

6
  • looks like Users/admin/Desktop is full-qualified path.
    – Jim
    Jul 13, 2013 at 12:01
  • 18
    @Jim: It does not have a leading /, and hence it is a relative path. A fully-qualified path on OS X or Linux starts with /; a fully-qualified path on Windows starts with a drive letter or share. Jul 13, 2013 at 12:02
  • I know this is an old thread but my question is 'can we do the same thing programatically ' I have done somthing like this ProcessBuilder proc = new ProcessBuilder("adb pull /storage/sdcard/s.txt C:/Users/401896/Desktop/adbPush.txt"); Process p = proc.start(); And its gioving error to me Aug 12, 2015 at 14:13
  • 1
    @SidharthDash: Your code might work on the desktop. If you are expecting that code to work on the device, you are sorely mistaken. If you are trying to write a desktop Java program that automates adb commands, ask a fresh Stack Overflow question where you show your code and your error. Aug 12, 2015 at 14:17
  • @CommonsWare I am replying to this thread because i am not able to post new question :( . Talking about the issue i am running this java code in PC and want to copy a file from emulator to PC. I have google and according to best answers even in SO they have use the code as written by me. P.S. when i am using simple "ls" commmand its working fine. But while copying to PC its throwing error. Aug 12, 2015 at 14:24
54

Judging by the desktop folder location you are using Windows. The command in Windows would be:

adb pull /sdcard/log.txt %USERPROFILE%\Desktop\
2
  • 1
    for windows systems this surely works. if we try adb pull /sdcard/*.txt %USERPROFILE%\Desktop\ this could bring all the txt files present on the device. Jan 23, 2014 at 13:52
  • 4
    i had to use adb pull /sdcard/log.txt %USERPROFILE%\Desktop\log.txt otherwise it said no such file or directory
    – gattsbr
    Sep 17, 2015 at 20:06
8

Be root, Define file on device and define new filename.

adb root
adb pull /data/data/.../databases/launcher.db launcher.db
5

On Windows, start up Command Prompt (cmd.exe) or PowerShell (powershell.exe). To do this quickly, open a Run Command window by pressing Windows Key + R. In the Run Command window, type "cmd.exe" to launch Command Prompt; However, to start PowerShell instead, then type "powershell". If you are connecting your Android device to your computer using a USB cable, then you will need to check whether your device is communicating with adb by entering the command below:

# adb devices -l  

Next, pull (copy) the file from your Android device over to Windows. This can be accomplished by entering the following command:

# adb pull /sdcard/log.txt %HOME%\Desktop\log.txt  

Optionally, you may enter this command instead:

# adb pull /sdcard/log.txt C:\Users\admin\Desktop\log.txt 
0

List item

Use following command to pull data from ADB

adb pull data/user/0/project package name/files/.local/share/dbname C:\Users\vijayalaxmi.k

data/user/0/project package name/files/.local/share/dbname this path you will get when you debug application. i.e database path

project package name example => com.example

instead of C:\Users\vijayalaxmi.k user your own path where you want to save your file. for example, c:\documents

-2

do adb pull \sdcard\log.txt C:Users\admin\Desktop

2
  • 6
    This is an old question that has already received answers and even has an accepted one - additionally, your path is wrong!
    – Léo Lam
    Feb 2, 2014 at 19:16
  • 5
    But welcome to stack overflow! Please poke around a bit and read some guidelines. Always happy to see new people join the community and contribute.
    – funroll
    May 12, 2015 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.