3

Sometimes i investigate foreign phones, where i can't root or install any Apps.

But i want to examine the filesystem via adb shell, and view some text-files. Like i usually do with a *nix-shell: with the less or the more command.

Both are absent in the shell, that i can access with adb shell.

My workaround until now is using the linux tool screen in conjunction with the adb-shell-command cat. (C-a Esc to scroll, '/' to search, Esc Esc to quit Copy-mode)

2
  • Can you provide more specifics of what your question is? Are you wanting to know if there is a way to use something like less or more in an Android Terminal Emulator or when using ADB on a computer? when running adb commands I would think that you would be able to pipe them to less, more or grep. To sue them from a Terminal Emulator I am pretty sure that you have to have root and busybox. Also, what kind of device are you using?
    – znewman
    Commented Feb 16, 2014 at 17:23
  • Thank you for your reply, Ok it was less obvious then i thought, i know i can run adb shell cat /path/to/my/file | less but i like to do adb shell ones, and then something like less /path/to/my/file.
    – Lutz L.
    Commented Feb 17, 2014 at 15:09

1 Answer 1

3

I know this question is a bit old. But I run into exactly the same problem and would like to share my solutions.

1st solution

Check if toybox is installed. If you are lucky, ls | toybox more may work.

2nd solution

However, I am not satisfied with the first solution, since more does not support going backwards. It turns out that vim is installed. In this case, you can run ls | vim -.

3rd solution

If you use emacs, calling adb shell in shell or eshell solves the problem. This is more or less the same as your screen workaround.

1
  • 2
    I just want to add that toybox was shipped with Android starting with Lollipop.
    – Firelord
    Commented Aug 25, 2018 at 10:08

You must log in to answer this question.

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