obj.info()
17:46:25.421 $ curl -X POST -d '{"jsonrpc": "2.0", "id": "4ba759d3c8259107bf8705a520a0ede4", "method": "objInfo", "params": [{"mask": 1, "childOrSibling": [], "childOrSiblingSelector": [], "text": "\u6e38\u620f"}]}' 'http://127.0.0.1:1
2285/jsonrpc/0'
17:47:25.451 $ curl -X POST -d '{"jsonrpc": "2.0", "id": 1, "method": "deviceInfo"}' 'http://127.0.0.1:12285/jsonrpc/0'
17:47:25.523 Response (71 ms) >>>
{"jsonrpc":"2.0","id":1,"result":{"currentPackageName":"com.zhuoyi.market","displayHeight":1570,"displayRotation":0,"displaySizeDpX":360,"displaySizeDpY":820,"displayWidth":720,"productName":"小辣椒50","screenOn":true,"sdkInt":28,"natu
ralOrientation":true}}
<<< END
17:47:25.529 $ curl -X POST -d '{"jsonrpc": "2.0", "id": "d5a04ed2454fdfff26e70a8773c4c62b", "method": "objInfo", "params": [{"mask": 1, "childOrSibling": [], "childOrSiblingSelector": [], "text": "\u6e38\u620f"}]}' 'http://127.0.0.1:1
2285/jsonrpc/0'
Traceback (most recent call last):
File "D:\installer\conda\lib\site-packages\urllib3\connectionpool.py", line 426, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "D:\installer\conda\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
httplib_response = conn.getresponse()
File "D:\installer\conda\lib\http\client.py", line 1347, in getresponse
response.begin()
File "D:\installer\conda\lib\http\client.py", line 307, in begin
version, status, reason = self._read_status()
File "D:\installer\conda\lib\http\client.py", line 268, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "D:\installer\conda\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\installer\conda\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "D:\installer\conda\lib\site-packages\urllib3\connectionpool.py", line 726, in urlopen
retries = retries.increment(
File "D:\installer\conda\lib\site-packages\urllib3\util\retry.py", line 410, in increment
raise six.reraise(type(error), error, _stacktrace)
File "D:\installer\conda\lib\site-packages\urllib3\packages\six.py", line 735, in reraise
raise value
File "D:\installer\conda\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "D:\installer\conda\lib\site-packages\urllib3\connectionpool.py", line 428, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "D:\installer\conda\lib\site-packages\urllib3\connectionpool.py", line 335, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='127.0.0.1', port=12285): Read timed out. (read timeout=60)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "", line 2, in info
File "D:\installer\conda\lib\site-packages\retry\api.py", line 73, in retry_decorator
return retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "D:\installer\conda\lib\site-packages\retry\api.py", line 33, in retry_internal
return f()
File "D:\installer\conda\lib\site-packages\uiautomator2_selector.py", line 130, in info
return self.jsonrpc.objInfo(self.selector)
File "D:\installer\conda\lib\site-packages\uiautomator2__init.py", line 435, in call
return self.server._jsonrpc_retry_call(self.method, params,
File "D:\installer\conda\lib\site-packages\uiautomator2__init__.py", line 451, in _jsonrpc_retry_call
return self._jsonrpc_call(*args, **kwargs)
File "D:\installer\conda\lib\site-packages\uiautomator2\init.py", line 471, in _jsonrpc_call
res = self.http.post("/jsonrpc/0",
File "D:\installer\conda\lib\site-packages\requests\sessions.py", line 578, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "D:\installer\conda\lib\site-packages\uiautomator2\init.py", line 188, in request
return super().request(method, url, **kwargs)
File "D:\installer\conda\lib\site-packages\uiautomator2\init__.py", line 108, in request
resp = super(TimeoutRequestsSession,
File "D:\installer\conda\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, send_kwargs)
File "D:\installer\conda\lib\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, kwargs)
File "D:\installer\conda\lib\site-packages\requests\adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='127.0.0.1', port=12285): Read timed out. (read timeout=60)
手机型号 Android 9.0
uiautomator2的版本号(
pip show uiautomator2
) Name: uiautomator2 Version: 2.12.1 Summary: Python Wrapper for Google Android UiAutomator2 test tool Home-page: https://github.com/openatx/uiautomator2 Author: codeskyblue Author-email: codeskyblue@gmail.com License: MIT Location: d:\installer\conda\lib\site-packages Requires: requests, lxml, six, whichcraft, progress, logzero, Deprecated, Pillow, adbutils, packaging, retry, cached-property Required-by: weditor手机截图
相关日志(Python控制台错误信息, adb logcat完整信息, atxagent.log日志)
最好能附上可能复现问题的代码。
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "D:\installer\conda\lib\site-packages\requests\adapters.py", line 439, in send resp = conn.urlopen( File "D:\installer\conda\lib\site-packages\urllib3\connectionpool.py", line 726, in urlopen retries = retries.increment( File "D:\installer\conda\lib\site-packages\urllib3\util\retry.py", line 410, in increment raise six.reraise(type(error), error, _stacktrace) File "D:\installer\conda\lib\site-packages\urllib3\packages\six.py", line 735, in reraise raise value File "D:\installer\conda\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen httplib_response = self._make_request( File "D:\installer\conda\lib\site-packages\urllib3\connectionpool.py", line 428, in _make_request self._raise_timeout(err=e, url=url, timeout_value=read_timeout) File "D:\installer\conda\lib\site-packages\urllib3\connectionpool.py", line 335, in _raise_timeout raise ReadTimeoutError( urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='127.0.0.1', port=12285): Read timed out. (read timeout=60)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 1, in
File "", line 2, in info
File "D:\installer\conda\lib\site-packages\retry\api.py", line 73, in retry_decorator
return retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
File "D:\installer\conda\lib\site-packages\retry\api.py", line 33, in retry_internal
return f()
File "D:\installer\conda\lib\site-packages\uiautomator2_selector.py", line 130, in info
return self.jsonrpc.objInfo(self.selector)
File "D:\installer\conda\lib\site-packages\uiautomator2__init.py", line 435, in call
return self.server._jsonrpc_retry_call(self.method, params,
File "D:\installer\conda\lib\site-packages\uiautomator2__init__.py", line 451, in _jsonrpc_retry_call
return self._jsonrpc_call(*args, **kwargs)
File "D:\installer\conda\lib\site-packages\uiautomator2\init.py", line 471, in _jsonrpc_call
res = self.http.post("/jsonrpc/0",
File "D:\installer\conda\lib\site-packages\requests\sessions.py", line 578, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "D:\installer\conda\lib\site-packages\uiautomator2\init.py", line 188, in request
return super().request(method, url, **kwargs)
File "D:\installer\conda\lib\site-packages\uiautomator2\init__.py", line 108, in request
resp = super(TimeoutRequestsSession,
File "D:\installer\conda\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, send_kwargs)
File "D:\installer\conda\lib\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, kwargs)
File "D:\installer\conda\lib\site-packages\requests\adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='127.0.0.1', port=12285): Read timed out. (read timeout=60)