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)

  • 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 Feb 16 '14 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. Feb 17 '14 at 15:09
2

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
    I just want to add that toybox was shipped with Android starting with Lollipop. – Firelord Aug 25 '18 at 10:08

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.