Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable Android adb shell history with up / down keys in under Linux?

I recently upgraded to the new Android SDK and I noticed something very very bothering. It seems it is no more possible to use the command history in the shell. Are you noticing the same? The Android shell seems horrible to me, but at least, in the last SDK, I had the command history. Now, it seems that pressing the up/down arrow, result in some codes written on the prompt (something like ^[[A, ^[[B etc...). I tried to read a little bit around but I found very few asking this a zero answers. Any idea why this happens and how to solve this?

like image 964
Luca Carlon Avatar asked Dec 18 '10 13:12

Luca Carlon


1 Answers

You can run the shell inside rlwrap:

rlwrap adb shell

I prefer to run it in an Emacs shell buffer myself, I recommend this if you're not allergic to Emacs. Emacs is also nice for running adb logcat: you get a searchable history and the messages are updated as they come, and you can easily put interesting patterns in color (M-x highlight-regexp and friends).

like image 55
Gilles 'SO- stop being evil' Avatar answered Nov 15 '22 17:11

Gilles 'SO- stop being evil'