Closed uohoo closed 5 years ago
You should use python 2.7.
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)
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
I found the problem, BS was blocking connection because adb was disabled. I just had to enable Adb on BlueStacks options.
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.