使用 iOS 模拟器时,点击 connect 报错:
错误信息如下:
Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1016, in _send_output
self.send(msg)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 956, in send
self.connect()
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connection.py", line 184, in connect
conn = self._new_conn()
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /status (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/wda/init.py", line 70, in httpdo
response = requests.request(method, url, data=data, timeout=HTTP_TIMEOUT)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /status (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
raise err
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1229, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1275, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1224, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 1016, in _send_output
self.send(msg)
File "/Users/luojilab/.pyenv/versions/3.7.0/lib/python3.7/http/client.py", line 956, in send
self.connect()
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connection.py", line 184, in connect
conn = self._new_conn()
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: : Failed to establish a new connection: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /status (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/luojilab/weditor/weditor/web/handlers/page.py", line 153, in post
id = connect_device(platform, device_url)
File "/Users/luojilab/weditor/weditor/web/device.py", line 103, in connect_device
d = AppleDevice(device_url)
File "/Users/luojilab/weditor/weditor/web/device.py", line 55, in __init_
self.scale = c.session().scale
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/wda/init_.py", line 252, in session
sid = self.status()['sessionId']
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/wda/init.py", line 191, in status
res = self.http.get('status')
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/wda/init.py", line 101, in fetch
return self._fetch_no_alert(method, url, data)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/wda/init.py", line 107, in _fetch_no_alert
return httpdo(target_url, method, data)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/wda/init_.py", line 75, in httpdo
response = requests.request(method, url, data=data, timeout=HTTP_TIMEOUT)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/Users/luojilab/.pyenv/versions/3.7.0/envs/venv/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8100): Max retries exceeded with url: /status (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 61] Connection refused'))
求大神指点
还招吗?