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

FEATURE REQUEST: usbmuxd2 support #1147

Open
fish4terrisa-MSDSM opened this issue Aug 3, 2024 · 2 comments
Open

FEATURE REQUEST: usbmuxd2 support #1147

fish4terrisa-MSDSM opened this issue Aug 3, 2024 · 2 comments

Comments

@fish4terrisa-MSDSM
Copy link

fish4terrisa-MSDSM commented Aug 3, 2024

Usbmuxd2 is a new kind of usbmuxd.
It seems that when usbmuxd2 is connected with the device(I can run idevice_id to get the id, and use ideviceinfo to get device info, use idevicesyslog to get the log...etc.)
However, pymobiledevice3 cannot connect to the device.
It always give the error:

pymobiledevice3.exceptions.ConnectionFailedError: got an error message: {'MessageType': 'Result', 'Number': 3}

A full error log with sudo pymobiledevice3 usbmux list ( I can use ideviceinfo and idevice_id when I'm running this command ):

Traceback (most recent call last):
  File "/usr/bin/pymobiledevice3", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/pymobiledevice3/__main__.py", line 100, in main
    cli()
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pymobiledevice3/cli/usbmux.py", line 65, in usbmux_list
    lockdown = create_using_usbmux(udid, autopair=False, connection_type=device.connection_type,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pymobiledevice3/lockdown.py", line 716, in create_using_usbmux
    service = ServiceConnection.create_using_usbmux(serial, port, connection_type=connection_type,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pymobiledevice3/service_connection.py", line 94, in create_using_usbmux
    sock = target_device.connect(port, usbmux_address=usbmux_address)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pymobiledevice3/usbmux.py", line 88, in connect
    return mux.connect(self, port)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pymobiledevice3/usbmux.py", line 221, in connect
    self._connect(device.devid, socket.htons(port))
  File "/usr/lib/python3.12/site-packages/pymobiledevice3/usbmux.py", line 379, in _connect
    self._send_receive({'MessageType': 'Connect', 'DeviceID': device_id, 'PortNumber': port})
  File "/usr/lib/python3.12/site-packages/pymobiledevice3/usbmux.py", line 402, in _send_receive
    raise self._raise_mux_exception(response['Number'], f'got an error message: {response}')
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/pymobiledevice3/usbmux.py", line 242, in _raise_mux_exception
    raise exception(message)
pymobiledevice3.exceptions.ConnectionFailedError: got an error message: {'MessageType': 'Result', 'Number': 3}

Does anyone know how to fix it?
Usbmuxd2 is the only kind of usbmuxd that can connect my ipad pro m4 with ios 17.4 through tailscale...

@doronz88
Copy link
Owner

doronz88 commented Aug 4, 2024

Unfortunately, usbmuxd2 does not support the Connect protocol message. The correct fix would be to submit a PR to usbmuxd2 to support it.

You can however add support for pymobile to support it since you managed to build usbmuxd2 so feel free to PR whichever project

@doronz88 doronz88 changed the title [BUG] Unable to use pymobiledevice3 with usbmuxd2 Unable to use pymobiledevice3 with usbmuxd2 Aug 4, 2024
@doronz88 doronz88 changed the title Unable to use pymobiledevice3 with usbmuxd2 FEATURE REQUEST: usbmuxd2 support Aug 4, 2024
@jordus100
Copy link

jordus100 commented Aug 7, 2024

@fish4terrisa-MSDSM I also struggled with a very similar problem until I discovered that pymobiledevice3 is able to connect to lockdownd wirelessly on my iPhone on its own without usbmuxd2. You can try enabling wireless lockdown connections and then pymobiledevice3 tunneld should be able to discover the iOS device and connect to it.

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