Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] ADB pull problem on linux

OP smokewagon

18th January 2014, 06:07 PM   |  #1  
OP Junior Member
Seattle
Thanks Meter: 1
 
18 posts
Join Date:Joined: Dec 2011
More
Hi All,

I am in the process of trying to root and install a custom rom on my Nexus 4 4.4.2. I am a new linux user (Linux Mint 16) and my rooting experience is limited. When I try to do an "abd pull /sdcard/ /sdcard/" this is what it says

adb pull /sdcard/ /sdcard/
pull: building file list...
pull: /sdcard/Android/data/com.google.android.gallery3d/cache/imgcache.1 -> /sdcard/Android/data/com.google.android.gallery3d/cache/imgcache.1
cannot create '/sdcard/Android/data/com.google.android.gallery3d/cache/imgcache.1': No such file or directory

I was able to successfully do an abd backup...
USB debugging is enabled.
I get the same error whether the phone is connected as a Media device (MTP) or Camera (PTP).

any reason why the pull command wont work?

Any help is appreciated!
18th January 2014, 06:56 PM   |  #2  
Berrydroidcafe's Avatar
Senior Member
Flag Cleveland Ohio - San Diego Ca
Thanks Meter: 231
 
1,032 posts
Join Date:Joined: May 2011
More
Quote:
Originally Posted by smokewagon

Hi All,

I am in the process of trying to root and install a custom rom on my Nexus 4 4.4.2. I am a new linux user (Linux Mint 16) and my rooting experience is limited. When I try to do an "abd pull /sdcard/ /sdcard/" this is what it says

adb pull /sdcard/ /sdcard/
pull: building file list...
pull: /sdcard/Android/data/com.google.android.gallery3d/cache/imgcache.1 -> /sdcard/Android/data/com.google.android.gallery3d/cache/imgcache.1
cannot create '/sdcard/Android/data/com.google.android.gallery3d/cache/imgcache.1': No such file or directory

I was able to successfully do an abd backup...
USB debugging is enabled.
I get the same error whether the phone is connected as a Media device (MTP) or Camera (PTP).

any reason why the pull command wont work?

Any help is appreciated!

Maybe this will help?

http://www.herongyang.com/Android/ad...l-Command.html

Not a big fan of the CLI.

Sent from my Nexus 7 (2013)
The Following User Says Thank You to Berrydroidcafe For This Useful Post: [ View ]
19th January 2014, 03:44 AM   |  #3  
Senior Member
Thanks Meter: 160
 
245 posts
Join Date:Joined: Apr 2011
Your problem (almost certainly) is that you don't have a /sdcard directory (folder) on your computer unless you created one (there certainly is no default /sdcard in a linux desktop system).

I also don't know how you installed ADB on your computer.
(This should work, otherwise I'll have to change what I wrote below).


Try this:

$ cd ~/Desktop

(This changes you to your desktop directory, if you are not already there)

$ mkdir sdcard

(this will make a new directory called "sdcard" on your desktop, you should see it pop up on your desktop)

$ adb pull /sdcard/ ~/Desktop/sdcard

(should pull the contents of /sdcard from your phone and put them in your newly created directory on your desktop: ~/Desktop/sdcard)

BAM


A little extra basic info for you, and welcome to linux. Soon you have the power to take over the world (ha ha ha... no, actually I'm not kidding at all).

As a basic rule, you should pretty much always be working inside of your home directory, for dealing with your personal files. Your home directory is /home/yourname. On my computers, my home is /home/kirk. My wife's home directory is /home/amy.

"~" is a shortcut for the home directory, for whomever is logged in at that moment.

If you wanted something that is on your desktop, it would be in the directory: /home/yourname/Desktop (~/Desktop). If you wanted to use your documents directory, it is : /home/yourname/Documents(~/Documents).

/home/yourname is where you usually where want to do your stuff.

"/" is the very root directory of the whole system, so you would be better off not creating and doing things like making directories like "/sdcard". That's a bad move. Leave root for system files. Not that you are necessarily going to destroy something by creating a /sdcard directory. But it'll cause you a few hassles.

So, use /home/yourname/sdcard (~/sdcard). Or if you want it on your desktop, (like I did above) use /home/yourname/Desktop/sdcard (~/Desktop/sdcard). Doing things inside of /home/yourname(~) means that you are the owner of that folder and everything in it, not root.

Otherwise you will just be causing headaches for yourself and having to grant yourself root permissions to work with those files (hassle). There's no good reason to do that to yourself. And if you did give yourself root permissions, and screwed up other stuff in the root directory like in: /etc or /dev or /bin, then you will REALLY be irritated.

Stick to your home for your personal files. /home/yourname (~)

Leave "/" or the "root" directory for system files.
Last edited by iowabeakster; 19th January 2014 at 03:47 AM.
The Following User Says Thank You to iowabeakster For This Useful Post: [ View ]
19th January 2014, 10:25 AM   |  #4  
mihahn's Avatar
Recognized Contributor
Thanks Meter: 2,205
 
3,245 posts
Join Date:Joined: May 2012
More
You could check my little bash program for adb for Linux too. It's a program to be used in the terminal and it'll pull data off the sdcard etc. You can find it here

Sent from my Nexus 4 running Android 4.4
Last edited by mihahn; 19th January 2014 at 10:28 AM.
The Following User Says Thank You to mihahn For This Useful Post: [ View ]
19th January 2014, 08:29 PM   |  #5  
OP Junior Member
Seattle
Thanks Meter: 1
 
18 posts
Join Date:Joined: Dec 2011
More
Thank you all for the help, I'll let you know how it goes.

Do I need drivers for my nexus 4 to work with Linux?

Sent from my Nexus 4 using Tapatalk
19th January 2014, 09:11 PM   |  #6  
mihahn's Avatar
Recognized Contributor
Thanks Meter: 2,205
 
3,245 posts
Join Date:Joined: May 2012
More
Quote:
Originally Posted by smokewagon

Thank you all for the help, I'll let you know how it goes.

Do I need drivers for my nexus 4 to work with Linux?

Sent from my Nexus 4 using Tapatalk

Try it without any installation of drivers just install adb tools and try the command line or my little tool. If it's not working, check the guides how to set up the usb-rules for adb

Sent from my Nexus 4 running Android 4.4
The Following User Says Thank You to mihahn For This Useful Post: [ View ]
19th January 2014, 09:45 PM   |  #7  
OP Junior Member
Seattle
Thanks Meter: 1
 
18 posts
Join Date:Joined: Dec 2011
More
Thanks, will do.

Sent from my Nexus 4 using Tapatalk
22nd January 2014, 04:51 AM   |  #8  
OP Junior Member
Seattle
Thanks Meter: 1
 
18 posts
Join Date:Joined: Dec 2011
More
Thumbs up
Quote:
Originally Posted by iowabeakster

Try this:

$ cd ~/Desktop

(This changes you to your desktop directory, if you are not already there)

$ mkdir sdcard

(this will make a new directory called "sdcard" on your desktop, you should see it pop up on your desktop)

$ adb pull /sdcard/ ~/Desktop/sdcard

(should pull the contents of /sdcard from your phone and put them in your newly created directory on your desktop: ~/Desktop/sdcard)

BAM

BAM INDEED! It worked! I am pulling the contents now. Thanks a ton, and thanks for the other basic linux info, I will put it to good use.

Any other tips on using Linux to root android?
22nd January 2014, 05:11 AM   |  #9  
OP Junior Member
Seattle
Thanks Meter: 1
 
18 posts
Join Date:Joined: Dec 2011
More
Shooooot....

So after the pull command finished, i opened the sdcard directory I created on my desktop, and it was empty....the pull command said this when it was done...

1733 files pulled. 0 files skipped.
2129 KB/s (995292697 bytes in 456.480s)

Any ideas?
22nd January 2014, 05:58 AM   |  #10  
OP Junior Member
Seattle
Thanks Meter: 1
 
18 posts
Join Date:Joined: Dec 2011
More
Ok, I played with some settings and got it to work, though I don't know why it worked.

USB Debugged is enabled.

The first time I tried to 'pull' i had my USB computer connection set to "Camera (PTP)" - it didn't work.

I tried again changing the USB computer connection to "Media device (MTP)" - it didn't work.

I changed it back to "Camera (PTP)" and my computer recognized it in a different way than the first time (a dialog box popped up asking me what I wanted to do with the pictures that were on the device I had connected, this didn't happen the first time).

I am glad the pull command finally worked, I just wish I knew why.

I guess it's a tough road being a linux NOOB and a (near) Android NOOB. It's good to learn something new and keep my brain young.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes