Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

takeSnapshot ERROR #268

Closed
uohoo opened this issue Sep 30, 2019 · 4 comments
Closed

takeSnapshot ERROR #268

uohoo opened this issue Sep 30, 2019 · 4 comments

Comments

@uohoo
Copy link

uohoo commented Sep 30, 2019

When I try to use the functionality takeSnapshot, it seems that the socket is closed, I get the following error. I'm using BlueStacks emulator and is detecting the device correctly.
When trying the other method, the alternative to USE_ADB_FRAMEBUFFER_METHOD, it shows the same behaviour.

Exception has occurred: RuntimeError
ERROR: b'FAIL' b'0006closed'
  File "C:\Program Files\Python37\Lib\site-packages\androidviewclient3\adb\adbclient.py", line 350, in __checkOk
    raise RuntimeError("ERROR: %s %s" % (repr(recv), error))
  File "C:\Program Files\Python37\Lib\site-packages\androidviewclient3\adb\adbclient.py", line 289, in __send
    self.__checkOk()
  File "C:\Program Files\Python37\Lib\site-packages\androidviewclient3\adb\adbclient.py", line 778, in takeSnapshot
    self.__send('framebuffer:', checkok=True, reconnect=False)
@dtmilano
Copy link
Owner

dtmilano commented Oct 1, 2019

You should use python 2.7.

@uohoo
Copy link
Author

uohoo commented Oct 1, 2019

Thank you for your quick respond.
I tried with other emulators and physical devices using python3 and the code works properly.
Any idea what this problem could be related with? Could be that sending the string 'framebuffer:' using python3 has a different behaviour that causes the error close?
self.__send('framebuffer:', checkok=True, reconnect=False)

@uohoo
Copy link
Author

uohoo commented Oct 1, 2019

I was trying to find the problem and got this error message when executing the next line. I forced using the not FRAMEBUFFER method (BlueStacks uses the 25 sdk version which normally uses the FRAMEBUFFER method) but I guess that the same problem occurs when using FRAMEBUFFER.
self.shell('/system/bin/screencap -p', False).replace(b'\r\n', b'\n')

ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
shell(_cmd=/system/bin/screencap -p)
__checkTransport()
__send(shell:/system/bin/screencap -p, checkok=True, reconnect=False)
Canceling timer with ID=70
__checkOk()
checkConnected()
    checkConnected: returning True
Canceling timer with ID=71
    __checkOk: recv= b'FAIL'
Canceling timer with ID=72
shell(_cmd=/system/bin/screencap -p)
__checkTransport()
__send(shell:/system/bin/screencap -p, checkok=True, reconnect=False)
Canceling timer with ID=73
__checkOk()
checkConnected()
    checkConnected: returning True
Canceling timer with ID=74

@uohoo
Copy link
Author

uohoo commented Oct 2, 2019

I found the problem, BS was blocking connection because adb was disabled.
I just had to enable Adb on BlueStacks options.

@uohoo uohoo closed this as completed Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants