xiaocong / uiautomator

Python wrapper of Android uiautomator test tool.
MIT License
2.03k stars 638 forks source link

IOError: RPC server not started! #172

Open sunshineB opened 8 years ago

sunshineB commented 8 years ago

Hi I am trying to run some device test using python on Ubuntu 16.04 but I am getting an error - RPC server not started!

d.info Traceback (most recent call last): File "", line 1, in File "/home/sdk/.local/lib/python2.7/site-packages/uiautomator/init.py", line 584, in info return self.server.jsonrpc.deviceInfo() File "/home/sdk/.local/lib/python2.7/site-packages/uiautomator/init.py", line 425, in wrapper server.start(timeout=30) File "/home/sdk/.local/lib/python2.7/site-packages/uiautomator/init.py", line 481, in start raise IOError("RPC server not started!") IOError: RPC server not started!

Please tell me how to start?Thanks

prathikshetty commented 8 years ago

Hi ,

Please try below steps.

And also try print d.info instead of d.info in python code. Thanks

libyoung commented 7 years ago

405: self.adb.cmd("install", "-rt", os.path.join(base_dir, apk)).wait() it should modify with "-r -t" instead of "-rt".

codeskyblue commented 7 years ago

so what is the difference?

abhigarg commented 7 years ago

I got an error message for the command: adb install app-uiautomator.apk adb: error: cannot stat 'app-uiautomator.apk': No such file or directory

siva-kranthi commented 7 years ago

@abhigarg you have to use absolute path of the apk

didiaodanding commented 6 years ago

Execute d.info will result in the websocket disconnected

File "F:\python2.7\lib\site-packages\websocket_core.py", line 261, in send_frame l = self._send(data) File "F:\python2.7\lib\site-packages\websocket_core.py", line 426, in _send return send(self.sock, data) File "F:\python2.7\lib\site-packages\websocket_socket.py", line 117, in send return sock.send(data) socket.error: [Errno 10054]

somnmos commented 6 years ago

from uiautomator import Device d = Device('014E05DE0F02000E', adb_server_host='192.168.1.68', adb_server_port=5037) does above code really work? i get a "OSError: RPC server not started!". when both the adb and uiautomator are used in the same host(adb_server_host='127.0.0.1'), it works.