Skip to content

Provided instruction does not work or is not clear. #1

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

Closed
hakzarov opened this issue Mar 19, 2025 · 5 comments
Closed

Provided instruction does not work or is not clear. #1

hakzarov opened this issue Mar 19, 2025 · 5 comments

Comments

@hakzarov
Copy link

It says to put the following to the config:

device:
  name: "google-pixel-7-pro" # Your device identifier from 'adb devices'

So I called adb devices:

user@dev:~$ adb devices
List of devices attached
de32c005        device

Put de32c005 in the config but clearly it's not an IP address so it fails with:

  File "/home/user/projects/UnRayNeo/android-mcp-server/adbdevicemanager.py", line 15, in __init__
    self.device.connect(rsa_keys=[PythonRSASigner(pub, priv)], auth_timeout_s=5)
  File "/home/user/projects/UnRayNeo/android-mcp-server/.venv/lib/python3.11/site-packages/adb_shell/adb_device.py", line 675, in connect
    self._available, self._maxdata = self._io_manager.connect(self._banner, rsa_keys, auth_timeout_s, auth_callback, adb_info)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/projects/UnRayNeo/android-mcp-server/.venv/lib/python3.11/site-packages/adb_shell/adb_device.py", line 221, in connect
    self._transport.connect(adb_info.transport_timeout_s)
  File "/home/user/projects/UnRayNeo/android-mcp-server/.venv/lib/python3.11/site-packages/adb_shell/transport/tcp_transport.py", line 88, in connect
    self._connection = socket.create_connection((self._host, self._port), timeout=transport_timeout_s)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/share/uv/python/cpython-3.11.11-linux-x86_64-gnu/lib/python3.11/socket.py", line 839, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/share/uv/python/cpython-3.11.11-linux-x86_64-gnu/lib/python3.11/socket.py", line 974, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -3] Temporary failure in name resolution

Worked around that by adb shell -> ifconfig on my AR glasses and then put the IP into the config

@hakzarov
Copy link
Author

Just realized that I also needed to do adb tcpip 5555 so added it to my wrapper. I guess python could do that? Or did I configure it all in a weird way and there's an easier solution here?

@minhalvp
Copy link
Owner

I have changed the code such that it does actually use the device identifier from adb devices to connect. This means that the name in the config must also includes the port of the device (e.g. google-pixel-7-pro:5555). @hakzarov Thanks for bringing this to my attention 😄

@minhalvp
Copy link
Owner

Just realized that I also needed to do adb tcpip 5555 so added it to my wrapper. I guess python could do that? Or did I configure it all in a weird way and there's an easier solution here?

With the new changes, you would not need to do this. You can specify the port of the device in the config

@hakzarov
Copy link
Author

Amazing! This works. A little suggestion - config.yml.example should be config.yaml.example since error prone (at least I stumbled upon the fact that the script expects .yaml.

Thanks a lot for such a useful project! I'm using it to hack into my chinese AR glasses using WindSurf (https://github.com/OpenClosedOS/UnRayNeo if you're curious).

@edgan
Copy link
Contributor

edgan commented Mar 24, 2025

Amazing! This works. A little suggestion - config.yml.example should be config.yaml.example since error prone (at least I stumbled upon the fact that the script expects .yaml.

Added this as part of my PR #4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants