So I am trying to run your code on Windows, python 2.7:
adbrecord.py --show
But I get this error:
File "C:[path-to-code]\adb-event-record-master\adbrecord.py", line 73, in listAllEvent
stderr=PIPE)
File "C:\Python27\lib\subprocess.py", line 394, in init
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 644, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
So I tried to delve into subprocess.py and specifically look for the arguments passed in the constructor Popen as your code fails when calling subprocess.Popen(...) (adbrecord.py line 72)
adb = subprocess.Popen(self.adb_shell_command + [b'getevent', '-i'], stdin=PIPE, stdout=PIPE,
stderr=PIPE)
I tried to solve the issue by for example adding shell = True to subprocess.Popen:
adb = subprocess.Popen(self.adb_shell_command + [b'getevent', '-i'], stdin=PIPE, stdout=PIPE,
stderr=PIPE, shell = True)
Because I read somewhere that it's needed.
It apparently solved(?) the issue, but then I got the following error:
File "C:[path-to-code]\adb-event-record-master\adbrecord.py", line 67, in checkPermission
if subprocess.call(self.adb_command + [b'root']) != 0:
File "C:\Python27\lib\subprocess.py", line 172, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python27\lib\subprocess.py", line 394, in init
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 644, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
So I guess I basically need to add shell=True wherever subprocess is called.
Now I get:
line 68, in checkPermission
raise OSError('Insufficient permissions')
OSError: Insufficient permissions
Which I guess is related to permissions from my phone, so I'll try to solve the issue later.
PS.
This is how to constructor looks like in subprocess.py: