openatx / adbutils

pure python adb library for google adb service.
MIT License
780 stars 180 forks source link

Screen record error #51

Closed JustinDBruce closed 2 years ago

JustinDBruce commented 2 years ago

I'm using the below code block:

r = d.screenrecord(no_autostart=True) r.start() # start record r.stop_and_pull("video.mp4") # stop recording and pull video to local, then remove video from device

but when I stop recording I'm getting this error: Traceback (most recent call last): File "C:\Users...\main.py", line 277, in on_click_record self.r.stop_and_pull("~/Desktop/video.mp4") File "C:\Users...\Python39\site-packages\adbutils\mixin.py", line 565, in stop_and_pull self.stop() File "C:\Users...\Python39\site-packages\adbutils\mixin.py", line 558, in stop self._stream.send("\003") AttributeError: '_AdbStreamConnection' object has no attribute 'send'

Any help on this would be appreciated.

leng-yue commented 2 years ago

I think it should be self._stream.conn.send("\003")

JustinDBruce commented 2 years ago

Changing to your line gives me: TypeError: a bytes-like object is required, not 'str'

leng-yue commented 2 years ago

Sorry, it should be self._stream.conn.send(b"\003"). I forgot using b""

codeskyblue commented 2 years ago

thanks, fixed