5,600,429 Members 32,834 Now Online
XDA Developers Android and Mobile Development Forum

[Q] ADB pull problem on linux

Tip us?
 
smokewagon
Old
#1  
Junior Member - OP
Thanks Meter 1
Posts: 18
Join Date: Dec 2011
Location: Seattle
Default [Q] ADB pull problem on linux

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!
 
Berrydroidcafe
Old
#2  
Berrydroidcafe's Avatar
Senior Member
Thanks Meter 220
Posts: 976
Join Date: May 2011
Location: Cleveland Ohio - San Diego Ca
Quote:
Originally Posted by smokewagon View Post
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)
Blackberry Bold 9780 OS 7
HTC G2 (Desire Z) 4.4.2
LG Nexus 4 4.4.2
Asus Nexus 7 (2013) 4.4.2

Don't forget to hit the Thanks button if I helped in any way!

The Following User Says Thank You to Berrydroidcafe For This Useful Post: [ Click to Expand ]
 
iowabeakster
Old
(Last edited by iowabeakster; 19th January 2014 at 02:47 AM.)
#3  
Senior Member
Thanks Meter 157
Posts: 238
Join Date: 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.
The Following User Says Thank You to iowabeakster For This Useful Post: [ Click to Expand ]
 
mihahn
Old
(Last edited by mihahn; 19th January 2014 at 09:28 AM.)
#4  
mihahn's Avatar
Recognized Contributor
Thanks Meter 2038
Posts: 3,109
Join Date: May 2012
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


Devices/Links/Information:
 

Device:Google Nexus 4 8gb
ROM:Stock Android 4.3 [JWR66V]

Device:Google Nexus 7 32gb
ROM:Stock Android 4.4 [KRT16O]

Device:Xperia Mini Pro SK17i
ROM: Super Jelly Bean 6.0
Kernel:nAa 2.6 [CWM]

Device:Raspberry Pi Model B
OS: Arch Linux

For a Rooting Guide for xperia 2011 devices, click me! | To unlock the Bootloader, click me! | How to install a custom kernel/rom? Click me | Super Jelly Bean 6.0 for xperia mdpi
The Following User Says Thank You to mihahn For This Useful Post: [ Click to Expand ]
 
smokewagon
Old
#5  
Junior Member - OP
Thanks Meter 1
Posts: 18
Join Date: Dec 2011
Location: Seattle
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
 
mihahn
Old
#6  
mihahn's Avatar
Recognized Contributor
Thanks Meter 2038
Posts: 3,109
Join Date: May 2012
Quote:
Originally Posted by smokewagon View Post
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


Devices/Links/Information:
 

Device:Google Nexus 4 8gb
ROM:Stock Android 4.3 [JWR66V]

Device:Google Nexus 7 32gb
ROM:Stock Android 4.4 [KRT16O]

Device:Xperia Mini Pro SK17i
ROM: Super Jelly Bean 6.0
Kernel:nAa 2.6 [CWM]

Device:Raspberry Pi Model B
OS: Arch Linux

For a Rooting Guide for xperia 2011 devices, click me! | To unlock the Bootloader, click me! | How to install a custom kernel/rom? Click me | Super Jelly Bean 6.0 for xperia mdpi
The Following User Says Thank You to mihahn For This Useful Post: [ Click to Expand ]
 
smokewagon
Old
#7  
Junior Member - OP
Thanks Meter 1
Posts: 18
Join Date: Dec 2011
Location: Seattle
Thanks, will do.

Sent from my Nexus 4 using Tapatalk
 
smokewagon
Old
#8  
Junior Member - OP
Thanks Meter 1
Posts: 18
Join Date: Dec 2011
Location: Seattle
Quote:
Originally Posted by iowabeakster View Post
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?
 
smokewagon
Old
#9  
Junior Member - OP
Thanks Meter 1
Posts: 18
Join Date: Dec 2011
Location: Seattle
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?
 
smokewagon
Old
#10  
Junior Member - OP
Thanks Meter 1
Posts: 18
Join Date: Dec 2011
Location: Seattle
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.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes