Open chicharitomu14 opened 8 years ago
OK, the error is solved temporary. I have changed the timeout parameter in the init.py file.
It seems that adb
connection is very unstable, however, uiautomator depends on that to work. Almost all connection errors are caused by that, I'm planning rewrite a version based on ssh
connections.
Well, great idea.
@yifeikong @chicharitomu14 have you tried resolving the above problem?
@KD-MAT I have tried, but failed. It seems that this is a problem with the architecture that uiautomator is using. To communicate with android, UiAutomator pushes an apk to android(only on first run), and then use command line to start a rpc server on android, and then connects to the rpc server using adb port forwarding. None of the mentioned steps is reliable for a long-run communication. So, to fix this, there needs a total reconstruction of the tool.
Hi xiaocong, I am doing UI test on Android 4.1, python 2.7, but I am getting an error about UiAutomationService not connected. I want to know how to solve it. Thank you.
File "/usr/local/lib/python2.7/dist-packages/uiautomator/init.py", line 602, in dump content = self.server.jsonrpc.dumpWindowHierarchy(compressed, None) File "/usr/local/lib/python2.7/dist-packages/uiautomator/init.py", line 432, in wrapper return _method_obj(_args, *_kwargs) File "/usr/local/lib/python2.7/dist-packages/uiautomator/init.py", line 131, in call "%s: %s" % (jsonresult["error"]["data"]["exceptionTypeName"], jsonresult["error"]["message"]) uiautomator.JsonRPCError: JsonRPC Error code: 0, Message: java.lang.IllegalStateException: UiAutomationService not connected. Did you call #register()?