I used my new Moto X phone, then I encountered a basic problem. It's running Android 4.4.2.

I take a photo, and want to send it to my PC. The Gallery app tells me the photo is at /storage/emulated/0/DCIM/Camera/, but in 'adb shell'... I cannot find it.

shell@ghost:/ $ cd /storage/emulated/0/DCIM/Camera/                            
/system/bin/sh: cd: /storage/emulated/0/DCIM/Camera: No such file or directory  

I find it at /storage/emulated/legacy/DCIM/Camera/

Question 1: Why is the 'legacy' dir '0' dir?

Then I send it to the phone.

Question 2: Is there a convenient way to use 'adb pull' when I am in 'adb shell'?

➜  ~  adb pull /storage/emulated/legacy/DCIM/Camera/*.*                        
zsh: no matches found: /storage/emulated/legacy/DCIM/Camera/*.*
➜  ~  adb pull /storage/emulated/legacy/DCIM/Camera/IMG_20140302_105047591_HDR.jpg
5326 KB/s (2746404 bytes in 0.503s)

Question 3: Why can't I use '*' in adb pull?

Thank you for your reading this. Forgive my multiple questions. I really want to know why. Do you have any suggestions?


* is being processesd by YOUR zsh. There's no /storage/... path on YOUR system, where you're running the adb commands. zsh cannot possibly know that you're trying to talk to an android device, so it's trying to expand the wildcards using local system paths. Since that path doesn't exist, let alone have files in it, it's properly telling you "no matches".

You probably want

adb pull '/storage/emulated/legacy/DCIM/Camera/*.*'

Note the '-quotes. They prevent zsh from seeing the wilcards AS wildcards - they'll be treated like plain text by the shell, and passed in to adb as literal text.

| improve this answer | |
  • O,thanks!A nice answer.In this way {adb pull '[path]'},the path is only a string.can I use ` adb push ` where I use ` adb shell `? If you want to send a file to pc ,how you do ? – Ninja Mar 2 '14 at 4:09

Your Answer

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