Cannot connect to 127.0.0.1:58526 (Port shown under the Developer Mode of WSA)

Haowen He 21 Reputation points
2022-03-27T11:11:01.113+00:00

As shown in the title, I can't connect to 127.0.0.1:58526 via adb.
187272-image.png
(cannot connect to 127.0.0.1:58526: No connection could be made because the target machine actively refused it. (10061))
I checked the netstat and the result showed that Port 58526 is not listening! ( And of course my Developer Mode is ON)
187110-image.png
BTW, I can connect to WSA by the given IP in the WSA Setting panel( e.g.:172.22..).

How can I fix this? Thanks!

Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

7 answers

Sort by: Most helpful
  1. Slion 41 Reputation points
    2022-09-12T15:57:49.527+00:00

    Go to WSA settings Developer tab. Click on Manage developer settings which opens the Android developer options. Find USB debugging. turn it on if it was not already. If it is already on, turn it off before turning it back on. Go back to your Windows command prompt adb connect should work again.

    6 people found this answer helpful.

  2. Andrew Leader-MSFT 306 Reputation points Microsoft Employee Moderator
    2022-04-11T18:08:14.223+00:00

    Hi, have you tried the following...

    1. Reboot your PC
    2. Launch a WSA app (like Amazon Appstore)
    3. Attempt connecting again

    When you see the "target machine actively refused it" 10061 error, you'll often just have to reboot your PC and then relaunch WSA and try again.

    3 people found this answer helpful.

  3. kris 16 Reputation points
    2022-08-20T20:14:09.78+00:00

    Hey, so I've been able to find a solution to the issue.

    First, open a PowerShell window and run

    ipconfig

    You'll get a list containing lots of IP Addresses divided into categories. Look for a header with a Default tag.

    233184-ipconfig.png

    Now copy the IPv4 Address that's written there.

    Connect to the WSA using the following code:

    adb connect <Your IPv4 Address>:58526

    You'll get a prompt from WSA requesting you to allow debugging. Press Accept and you're done!

    Source:
    https://learn.microsoft.com/en-us/windows/android/wsa/

    3 people found this answer helpful.

  4. yahgoo 1 Reputation point
    2022-10-31T05:12:38.79+00:00

    Click Hamburger menu in WSA, select Developer
    Enable Developer mode
    Click Manage Developer Settings
    Enable Use Developer option
    Enable USB Debugging
    Restart pc
    In Terminal, type following commands
    adb connect <Your IPv4 Address>:58526
    adb install xxxx.apk


  5. Jennifer Guzman 0 Reputation points
    2023-03-27T22:57:23.21+00:00

    I don't know if Hyper-V is required to run WSA apps, but I was having this issue as well - unable to connect to the ADB port - and enabling Hyper-V solved this issue for me.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.