Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address already in use #85

Open
SmartManoj opened this issue Jan 7, 2023 · 3 comments
Open

Address already in use #85

SmartManoj opened this issue Jan 7, 2023 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@SmartManoj
Copy link

Need to adb kill-server

Traceback:

File "/home/smart/.local/lib/python3.10/site-packages/uiautomator2/_selector.py", line 360, in get_text
    self.must_wait(timeout=timeout)
  File "/home/smart/.local/lib/python3.10/site-packages/uiautomator2/_selector.py", line 344, in must_wait
    if not self.wait(exists, timeout):
  File "/home/smart/.local/lib/python3.10/site-packages/uiautomator2/_selector.py", line 314, in wait
    return self.jsonrpc.waitForExists(self.selector,
  File "/home/smart/.local/lib/python3.10/site-packages/uiautomator2/__init__.py", line 481, in __call__
    return self.server._jsonrpc_retry_call(self.method, params,
  File "/home/smart/.local/lib/python3.10/site-packages/uiautomator2/__init__.py", line 488, in _jsonrpc_retry_call
    return self._jsonrpc_call(*args, **kwargs)
  File "/home/smart/.local/lib/python3.10/site-packages/uiautomator2/__init__.py", line 514, in _jsonrpc_call
    res = self.http.post("/jsonrpc/0",
  File "/home/smart/.local/lib/python3.10/site-packages/requests/sessions.py", line 635, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
  File "/home/smart/.local/lib/python3.10/site-packages/uiautomator2/__init__.py", line 202, in request
    url = self.__client.path2url(url)
  File "/home/smart/.local/lib/python3.10/site-packages/uiautomator2/__init__.py", line 301, in path2url
    return urlparse.urljoin(self._get_atx_agent_url(), path)
  File "/home/smart/.local/lib/python3.10/site-packages/uiautomator2/__init__.py", line 282, in _get_atx_agent_url
    lport = self._adb_device.forward_port(
  File "/home/smart/.local/lib/python3.10/site-packages/adbutils/_device.py", line 236, in forward_port
    local_port = get_free_port()
  File "/home/smart/.local/lib/python3.10/site-packages/adbutils/_utils.py", line 26, in get_free_port
    s.bind(('127.0.0.1', 0))
OSError: [Errno 98] Address already in use
@codeskyblue
Copy link
Member

What kind system are you using @SmartManoj
I'm using this way to pick random port
https://stackoverflow.com/questions/1365265/on-localhost-how-do-i-pick-a-free-port-number

@codeskyblue codeskyblue added bug Something isn't working good first issue Good for newcomers labels Jan 28, 2023
@SmartManoj
Copy link
Author

Manjaro XFCE 21.3.7

@codeskyblue
Copy link
Member

5c1266f

Try to update adbutils to 1.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants