ATX python3 -m weditor 获取不到 hierarchy

workhard · 2018年01月27日 · 最后由 workhard 回复于 2018年01月29日 · 1748 次阅读

环境 Python3.6
atx version: 1.1.3.dev37
System: Mac

I 180127 15:56:13 web:2063] 200 GET /api/v1/devices/d1fd7f8f-7f4c-4b86-8b62-97114a05726a/screenshot (::1) 722.13ms
[E 180127 15:56:13 web:1590] Uncaught exception GET /api/v1/devices/d1fd7f8f-7f4c-4b86-8b62-97114a05726a/hierarchy (::1)
HTTPServerRequest(protocol='http', host='localhost:17310', method='GET', uri='/api/v1/devices/d1fd7f8f-7f4c-4b86-8b62-97114a05726a/hierarchy', version='HTTP/1.1', remote_ip='::1', headers={'Host': 'localhost:17310', 'Connection': 'keep-alive', 'Accept': 'application/json, text/javascript, /; q=0.01', 'Origin': 'http://atx.open.netease.com', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3322.3 Safari/537.36', 'Referer': 'http://atx.open.netease.com/', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,fr;q=0.7'})
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/tornado/web.py", line 1509, in execute
result = method(*self.path_args, **self.path_kwargs)
File "/usr/local/lib/python3.6/site-packages/weditor/
main.py", line 273, in get
self.write(uidumplib.get_android_hierarchy(d))
File "/usr/local/lib/python3.6/site-packages/weditor/uidumplib.py", line 103, in get_android_hierarchy
page_xml = d.dump_hierarchy(compressed=False, pretty=False).encode('utf-8')
File "/usr/local/lib/python3.6/site-packages/uiautomator2/
init.py", line 389, in dump_hierarchy
content = self.jsonrpc.dumpWindowHierarchy(compressed, None)
File "/usr/local/lib/python3.6/site-packages/uiautomator2/
init.py", line 232, in __call_
return self.server.jsonrpc_call(self.method, params, http_timeout)
File "/usr/local/lib/python3.6/site-packages/uiautomator2/init.py", line 266, in jsonrpc_call
raise err
uiautomator2.JsonRpcError: -32001 Server error: java.lang.IllegalStateException
[E 180127 15:56:13 web:2063] 500 GET /api/v1/devices/d1fd7f8f-7f4c-4b86-8b62-97114a05726a/hierarchy (::1) 67.19ms

共收到 3 条回复 时间 点赞

向手机端重装一下python -m uiautomator2 init

换个画面是不是就好了

python3 -m uiautomator2 init重装解决,谢谢两位

workhard 关闭了讨论 01月29日 11:20
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册