Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable and enable android touchscreen via adb

I need to disable and enable touchscreen on my android device. I tried this

adb shell su rm -rf /dev/input/event2 

and

adb shell su rm -rf /dev/input/event0

but have

tmp-mksh: tmp-mksh: - : unknown option

What command do I need to send to turn touch screen off and then on?

like image 427
Ксения Avatar asked Oct 28 '25 15:10

Ксения


1 Answers

I know, much too late for you, but maybe it might help others (as me, who found your thread). This is how it finally worked out for me with separate commands.

  • Requires adb root access to be enabled in android dev-settings.
  • In the third command, event1 can even be any other of the events in that folder. From my experience these events restore fully on reboot, so don't hesitate to try deleting them one by one.
  • This completely disables touch & access via mouse. However, scrcpy still works, even with input.
    adb root
    adb shell
    rm -rf /dev/input/event1
like image 88
Jonas Avatar answered Oct 31 '25 03:10

Jonas