`xtool dev` stuck on Connecting step · Issue #19 · xtool-org/xtool · GitHub
Skip to content

xtool dev stuck on Connecting step #19

Open

Description

@JustJoostNL

I am using WSL with USB passthrough. xtool dev is stuck every time on the [Connecting] step. I've got it to work once after retrying like 100 times.
Any idea what could be wrong here?

xtool dev
Planning...
[1/1] Planning build
Building for debugging...
[4/4] Linking Hello-App
Build of product 'Hello-App' complete! (1.73s)
Waiting for device to be connected...
Installing to device: xxx (udid: xxx)

[Unpacking app] 100%
[Logging in]   0%
[Preparing device] 100%
[Provisioning] 100%
[Signing] 100%
[Packaging] 100%
[Connecting] 100%
Pinned by kabiroberai

Activity

  1. kabiroberai commented on May 12, 2025

    @kabiroberai
    Member

    @11265 are you on WSL as well?

  2. 11265 commented on May 12, 2025

    @11265

    @11265 are you on WSL as well?

    yes,wsl(Ubuntu-24.04)

  3. forbidmellm commented on May 12, 2025

    @forbidmellm

    Same problem. Got a message after ~1min: Error: AFCClient.Error.muxError. Suggest it cannot connect in fact. Already tapped Trust button on Iphone. Run on WSL Ubuntu 24.04.1 LTS
    BTW in case when I stuck on Connecting stage, I cannot stop the command with ctrl+c or any other buttons as I could do before this stage. Hope it helps

  4. JustJoostNL commented on May 13, 2025

    @JustJoostNL
    Author

    Can confirm that, exact same behavior for me.

  5. JustJoostNL commented on May 13, 2025

    @JustJoostNL
    Author

    @kabiroberai Do you have any idea if this a real xtool issue or more a WSL bug?

  6. sevenc-nanashi commented on May 14, 2025

    @sevenc-nanashi
    Contributor

    I found a interesting log in journalctl -xfeu usbmuxd:

    May 14 16:15:55 nanaDows usbmuxd[1040161]: [16:15:55.015][3] usbmuxd v1.1.1 starting up
    May 14 16:15:55 nanaDows usbmuxd[1040161]: [16:15:55.016][3] Successfully dropped privileges to 'usbmux'
    May 14 16:15:55 nanaDows usbmuxd[1040161]: [16:15:55.016][3] Using libusb 1.0.27
    May 14 16:15:55 nanaDows usbmuxd[1040161]: [16:15:55.017][3] Initialization complete
    May 14 16:15:55 nanaDows usbmuxd[1040161]: [16:15:55.017][3] Enabled exit on SIGUSR1 if no devices are attached. Start a new instance with "--exit" to trigger.
    May 14 16:16:16 nanaDows usbmuxd[1040161]: libusb: warning [op_get_configuration] device unconfigured
    May 14 16:16:16 nanaDows usbmuxd[1040161]: libusb: error [op_get_active_config_descriptor] device unconfigured
    May 14 16:16:16 nanaDows usbmuxd[1040161]: [16:16:16.289][3] Could not get old configuration descriptor for device 1-8: LIBUSB_ERROR_NOT_FOUND
    May 14 16:16:16 nanaDows usbmuxd[1040161]: [16:16:16.297][3] Connecting to new device on location 0x10008 as ID 1
    May 14 16:16:16 nanaDows usbmuxd[1040161]: [16:16:16.298][3] Connected to v2.0 device 1 on location 0x10008 with serial number 00008140-00194D363C87001C
    May 14 16:16:21 nanaDows usbmuxd[1040161]: [16:16:21.690][1] device_control_input: ERROR (on device): asyncReadComplete, message was too large (65536 bytes, max = 65535)
    May 14 16:16:21 nanaDows usbmuxd[1040161]: [16:16:21.691][1] device_control_input: ERROR (on device): asyncReadComplete, message was too large (65536 bytes, max = 65535)
    May 14 16:16:21 nanaDows usbmuxd[1040161]: [16:16:21.713][2] device_control_input: Got unhandled payload type 4
    

    My device is iPhone 16, iOS 18.5.

  7. kabiroberai commented on May 14, 2025

    @kabiroberai
    Member

    Nice find @sevenc-nanashi, this looks like it's the same issue as dorssel/usbipd-win#959

    There's another approach to forwarding iPhone USB from Windows to WSL that involves installing iTunes (Apple Devices?) and then telling libimobiledevice to forward requests to port 27015. See libimobiledevice/usbmuxd#126 — I'll try to test this and suggest it over usbipd if it works.

  8. added
    bugSomething isn't working
    wslRelated to Windows Subsystem for Linux hosts
    on May 14, 2025
  9. KhoaSuperman commented on May 16, 2025

    @KhoaSuperman

    @prismios I have same issue. please share your setup steps that very helpful for me. Appreciated !!!

  10. JustJoostNL commented on May 16, 2025

    @JustJoostNL
    Author

    Would love to see some steps on how to set that up too!

  11. KhoaSuperman commented on May 20, 2025

    @KhoaSuperman

    @kabiroberai anything news, I tried recommended solution above but didn't work

  12. rena2019 commented on May 21, 2025

    @rena2019

    I had the same error: Error: AFCClient.Error.muxError but could connect via iTunes after I configured port forwarding as described in libimobiledevice/usbmuxd#126 (comment) with 2 small modifications:

    # 1. after installing iTunes from Windows Store -> connect to your iPhone
    # 2. windows cmd: check WSL interface name
    ipconfig
    ...
    Ethernet adapter vEthernet (WSL (Hyper-V firewall))
    ...
    IPv4 Address. . . . . . . . . . . : 172.22.32.1
    
    # 3. powershell: add firewall rule (this is a one-time setup) 
    New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL (Hyper-V firewall))" -Action Allow
    
    # 4. powershell: port forwarding
    $myhost = $(wsl -- ip route list default `| awk '{print \$3}')
    #or ipv4 adr (see #2) 
    $myhost = 172.22.32.1
    netsh interface portproxy set v4tov4 listenport=27015 connectaddress=127.0.0.1 connectport=27015 listenaddress=$myhost
    
    #5. WSL: check connection
    export USBMUXD_SOCKET_ADDRESS="$(ip route list default | awk '{print $3}'):27015"
    ideviceinfo
    
    #6. WSL: build & install app
    xtool dev
    Planning...
    [1/1] Planning build
    Building for debugging...
    [4/4] Linking Hello-App
    Build of product 'Hello-App' complete! (0.55s)
    Waiting for device to be connected...
    Installing to device: Rena’s iPhone (udid: 0000XXXX-00XXXXXXXXXXXXXX)
    
    [Unpacking app] 100%
    [Logging in]   0%
    [Preparing device] 100%
    [Provisioning] 100%
    [Signing] 100%
    [Packaging] 100%
    [Connecting] 100%
    [Installing] 100%
    [Verifying] 100%
    
    
  13. LorenzoFerri commented on May 24, 2025

    @LorenzoFerri

    @rena2019 guide worked for me ty.

  14. UE2020 commented on May 19, 2026

    @UE2020

    Why even say that xtool works on Windows when it clearly doesn't? This issue should be closed and the documentation should be updated.

  15. kabiroberai commented on May 21, 2026

    @kabiroberai
    Member

    Given a lot of people seem to have repro’d this + confirmed the port-forwarding approach works better, I’ll probably update the docs later this week to recommend that instead. Thank you to everyone who tested and validated this!

  16. MagFlux commented on Aug 23, 2026

    @MagFlux

    @kabiroberai I obviously appreciate all the hard work done to even let me get to this point but I just wasted money and hours of my day trying to get this working with WSL only to eventually find this thread and your comment...can you please for the sake of others going down my path, update the docs to reflect this issue so they aren't sent on a wild goose chase as well? Also can confirm #19 (comment) worked. 😃

  17. added a commit that references this issue on Aug 23, 2026
  18. kabiroberai commented on Aug 23, 2026

    @kabiroberai
    Member

    Pardon me, updated the docs with a link to the workaround in #19 (comment). Leaving this issue open because I still intend to provide step-by-step instructions, but this will help for now.

  19. MagFlux commented on Aug 23, 2026

    @MagFlux

    Pardon me, updated the docs with a link to the workaround in #19 (comment). Leaving this issue open because I still intend to provide step-by-step instructions, but this will help for now.

    Wow that was quick, thanks for doing that and thanks for the work you do supporting this repo!

  20. ThaUnknown commented on Sep 5, 2026

    @ThaUnknown

    I can't fix this no matter what

    Image Image
  21. MagFlux commented on Sep 5, 2026

    @MagFlux

    Does lsusb return anything within WSL? Also I believe it should behave the same but instead of iTunes I’m using the Apple Devices application (https://apps.microsoft.com/detail/9np83lwlpz9k?hl=en-US&gl=US).

  22. ThaUnknown commented on Sep 5, 2026

    @ThaUnknown

    lsusb listed the iphone

  23. aqolys commented on Oct 15, 2026

    @aqolys

    @ThaUnknown i had the same problem, heres what helped me:

    1. unbinding device in usbipd
    2. echo $USBMUXD_SOCKET_ADDRESS . in my option ip route list default returns 192.168.1.1 address, but with netsh we listening 127.0.0.1
    3. unset USBMUXD_SOCKET_ADDRESS
    4. export USBMUXD_SOCKET_ADDRESS="127.0.0.1:27015"
  24. Floxxoo commented on Oct 21, 2026

    @Floxxoo

    @MagFlux lsusb doesnt even show the iphone for me, everything looks similar to ThaUnknown's problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwslRelated to Windows Subsystem for Linux hosts

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions