The way I solved it in the question you referenced was by using adb push local_path remote_path
and the remote directory I used is /data/local/tmp/
which requires no root permissions.
To push a thing you just need to compile it locally and send push it. You can then run in on the device using adb shell absolute_path_to_script
To recap. If you want to make a custom script from a android/adb C source, you need to:
- compile it (lets say you get
my_script
) - don't forget to make it an executable with
chmod a+x my_script
- push it to the device
adb push my_script /data/local/tmp/my_script
- run it form the device
adb shell /data/local/tmp/my_script
Now to answer your other question about dragging, I ended up making my own custom sendevent script that takes a local file (from the android device), reads events line by line and sends them to the driver.
Here's the script http://pastebin.com/LWWiNA6U
It takes 3 arguments,
- the
file_input
, - the
file_output
- this is specific to every device, you need to check and see where do you need to write the raw binary data to emulate touch events. For the devices I used:/dev/input/event5
(for the HTC One M7) and/dev/input/event2
(for the Galaxy Note 8) - and the
sleep_time
- delay between every touch event being sent to the driver
Hope it helps
EDIT: Oh and btw, this is example input. It's standard converted from getevent
as far as I remember
0003 0039 4a
0003 0035 1cc
0003 0036 3a2
0000 0000 00000000
0003 0035 250
0003 0036 426
0000 0000 00000000
0003 0035 250
0003 0036 4aa
0000 0000 00000000
0003 0035 149
0003 0036 3a2
0000 0000 00000000
0003 0035 c5
0003 0036 3a2
0000 0000 00000000
0003 0039 ffffffff
0000 0000 00000000