Giter Club home page Giter Club logo

adb-event-record's Introduction

Hi there ๐Ÿ‘‹

I am TzuTa. You can call me Darren.

TzuTa's github stats Top Langs

  • ๐Ÿ”ญ Iโ€™m currently working for Amazon to build big data solution, recommender algorithm, Tier-1 services, web application and mobile app. After I joined Amazon, I didn't contribute to open source anymore. But if you have any question or would like to know more about me. You can check out https://tzutalin.github.io to reach out to me

adb-event-record's People

Contributors

cy-shriram avatar qh-huang avatar tzutalin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

adb-event-record's Issues

Running on windows error

I am trying to run it on Windows machine, because I have CAN device to work with, and I get following:

Python 3.6

python adbrecord.py --show
Traceback (most recent call last):
File "adbrecord.py", line 177, in
main(*sys.argv)
File "adbrecord.py", line 153, in main
adb_recorder.listAllEvent()
File "adbrecord.py", line 52, in listAllEvent
adb = subprocess.Popen(self.adb_shell_command + [b'getevent', '-i'], stdin=PIPE, stdout=PIPE, stderr=PIPE)
File "C:\Users\build-windows\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 707, in init
restore_signals, start_new_session)
File "C:\Users\build-windows\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 964, in _execute_child
args = list2cmdline(args)
File "C:\Users\build-windows\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 461, in list2cmdline
needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: a bytes-like object is required, not 'str'

WindowsError: [Error 2] when passing --show on Windows

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:
image

Some user experience( or questions)

  1. The record was not complete. My record contains the keyboard input, it is "deng wo 3 fenzhong", but replay is "eng wo 3 fenzhong ", miss the first character.
  2. The virtual button was not record. I tap the home button, but this tap was not recorded.
  3. Is the programe need root? There are some warning tips "adbd cannot run as root in production builds". If it is, could you add this to the readme file ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.