I know it's possible to simulate a keypress event in Android via adb using a command like:

adb shell input keyevent 24

The command above will trigger a Volume Key Up event, for example.

My problem is, my volume key is broken. I can get access to recovery mode using adb reboot recovery, but how can I navigate in recovery mode while my volume button is broken?

I've tried to use adb shell ... commands as above but it said that the "input" binary was not installed.

  • Does you device has support for USB OTG? Volume buttons and digitizer doesn't work in my old device but it has USB OTG support so I use a mouse to choose the options. It is another matter that in my device stock Recovery doesn't support OTG but custom one does. – Firelord Sep 1 '15 at 18:19
  • Hmm, how can i check if my device support USB on the go? And if it's supporedt how can i do it? Thanks :D – Idad Sep 1 '15 at 18:31
  • You can search on Google whether your device supports OTG. You may alternatively try apps like OTG Checker. If it's supported then you would have to buy an OTG cable (they are very cheap) and needs a standard mouse. Connect them and see the magic. – Firelord Sep 1 '15 at 18:33
  • @Firelord I follow your suggestion and OTG Checker app said my firmware support it. Hmm im still a bit in darkness haha. So you mean by connecting OTG Cable adapter with standard USB Mouse I can access the menu in Recovery Mode? Does the OTG driver loaded in recovery mode? If it can't (by using OTG Cable - USB Mouse), is there any command to invoke keypress event in recovery mode? Thanks in advance :). – Idad Sep 2 '15 at 16:23
  • As I said earlier my custom recovery loads drivers which supports some peripherals but stock one doesn't. It would depend upon which recovery you're using. Besides, did you mount /system when trying to use input command? Also I don't think it would work since it needs internals of full-fledged Android OS and Recovery is a bare-bone OS. – Firelord Sep 2 '15 at 16:55

Your Answer

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

Browse other questions tagged or ask your own question.