Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

continuous touch on the screen using ADB shell

I want to keep the camera button pressed to take continuous snaps. I tried this code:

#!/system/bin/sh
am start -n com.android.camera2/com.android.camera.CameraLauncher
sleep 1
count=1
x=2
while [ $count -le 1 ]
do 
    input touchscreen tap 560 1800
    input touchscreen tap 560 1800
    input touchscreen tap 560 1800
    input touchscreen tap 560 1800
    input touchscreen tap 560 1800
    input touchscreen tap 560 1800
    input touchscreen tap 560 1800
    input touchscreen tap 560 1800
done

But it does not hold the button. It taps with a delay.

Then I tried this:

 sendevent /dev/input/event0 3 53 300
 sendevent /dev/input/event0 3 54 400
 sendevent /dev/input/event0 3 48 5
 sendevent /dev/input/event0 3 58 50
 sendevent /dev/input/event0 0 2 0
 sendevent /dev/input/event0 0 0 0
 sleep 1
 sendevent /dev/input/event0 0 2 0
 sendevent /dev/input/event0 0 0 0

this code gets executed but the effect is not seen on the touchscreen

like image 796
user3659556 Avatar asked Jul 28 '26 07:07

user3659556


1 Answers

This will work adb shell input swipe 660 2200 660 2200 5000

The last value is duration

like image 128
Bandu M Avatar answered Jul 30 '26 22:07

Bandu M