Cartucho / android-touch-record-replay

How to record and replay touchscreen events on an Android device.
Apache License 2.0
224 stars 46 forks source link

Updated python script to output csv & documented discussion from issue#3 #4

Closed Axemasta closed 5 years ago

Axemasta commented 5 years ago

As per the discussion in Issue #3,

I have updated the human_readable_data.py script to output the touch data to a csv file.

I have changed the script to have the touchscreen device passed into the script as find_touchscreen_name.sh did not function correctly on my machine and this allowed me to specify which input I wanted to monitor.

All documentation for the file is included in the readme under a new section called "Outputting Touch Data".

Cartucho commented 5 years ago

Hello! Sorry for the late reply, I have been moving to another country (:

Quick suggestion, instead of opening the file every single time in the loop we should just open it once, run the loop and write the data to the .csv file and close that file after the loop.

What do you think?

Cartucho commented 5 years ago

I can commit my suggestions if you turn on the allow edits from maintainers.

image

Axemasta commented 5 years ago

Hey,

No worries. Yes see I wince every time I look at the code, you are right you definitely shouldn't be opening and closing the connection to the file every time you iterate through the data set. Annoyingly I can remember it not writing to the csv if I opened it at the start of the script and closed it at the end...

You are clearly much more knowledgeable about python than me, I wonder if you took at look you might have more success!

Axemasta commented 5 years ago

You should have access to edit

Cartucho commented 5 years ago

Unfortunately, I do not have a debuggable USB cable with me (I just moved to London).

I will merge this version and later on I will commit those changes. Thank you!

AhmadMuhtada commented 5 years ago

Hi, I tried your code and it end up like this

Traceback (most recent call last): File "C:\adb\human_readable_data.py", line 26, in time, event_data = output.decode('utf8').split(" ]", 1) ValueError: need more than 1 value to unpack

any solution ? thank you