2

I can't seem to pull or push files from my phone. The file exists, and I can get into the adb shell. But whether I do the command adb pull or adb shell and then pull, it doesn't work.

If I do it via shell, it gives me 'push: not found'. If I do adb pull on the Windows command line, it just gives me a list of all ADB commands (so it doesn't understand push or pull).

I am using the correct syntax:

  • Within shell: push (or pull) /path/to/file
  • Outside shell: adb push (or pull) /path/to/file

I am working as root too.

The file I need doesn't seem to be visible to the graphical file manager I have on the phone, even though it has root permissions and is showing hidden files. It's visible via adb, so it's definitely there!

What's wrong, and how do I fix it?

3
  • You are listing the path to the file after using adb pull or adb push from Windows Command Line? If you are just typing in adb push without anything else, you will only get a list of commands. Commented May 30, 2017 at 13:22
  • If you are "within the shell of Android", there is no point in using adb related commands and they won't work for achieving the end you're after. It's a different concept. If you are in the Windows shell than as RMarkwald says, you need to enter the full command (for push: both source and destination is required.)
    – Firelord
    Commented May 30, 2017 at 19:25
  • As you question goes, you want access to a file that's only visible to adb, but your description seems it's visible to adb shell (in other words, visible to the shell of the phone itself). If you're willing to move a file within the scope of the phone storage, use the classic Linux commands cp and mv in the shell.
    – Andy Yan
    Commented May 31, 2017 at 0:40

3 Answers 3

2

By your words, I suppose that you're running adb within an adb shell and that's wrong. See this answer for more details.

In case I misunderstood your question:
On Android, adbd is by default not running as root, so certain files and directories are not visible to the ADB client. Still, refer to my answer for more details.

There is no such command as push or pull on your Android device. All you can do is adb push from your host PC. Whatever non-existent command makes shell tell you aaabbb: not found so it's not a bug.

0
2

Use the following command from the Windows Power Shell or the Command prompt; not inside the adb shell: .\adb pull /system/etc/hosts C:\hosts

The .\adb is to show where to use the command adb from. It worked for me.

1
  • Thanks. I didn't knew this. Why though? Commented May 26, 2023 at 19:02
2

enter image description here

Use adb Directly in command prompt instead of adb shell use outside

adb  pull "/sdcard/WhatsApp Business/" "C:\Users\safva\OneDrive\Desktop\hi"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .