31

I can't debug over bluetooth with my Moto360.

To start I have enabled "ADB debugging" and "Debug over Bluetooth" on the Moto360. I have also enabled "Debugging over Bluetooth" via the companion phone. It shows:

Host: disconnected

Target: connected

When I connect the companion phone via USB, I can see it connect to adb using:

./adb devices

Then I try:

./adb forward tcp:4444 localabstract:/adb-hub

and then:

./adb connect localhost:4444

which returns:

unable to connect to localhost:4444:4444

I've tried a lot of things like resetting the moto360, killing the adb server, rebooting the computer, uninstalling platform tools via sdk manager and reinstalling them, trying a different port number. Nothing seems to work.

I was able to connect with my personal computer, but every time I try on my work computer I get: unable to connect to localhost:4444:4444

Community
  • 1
  • 1
user2825168
  • 383
  • 1
  • 3
  • 10
  • With reference with google issues tracker it has been fixed. https://issuetracker.google.com/issues/37091033 – Prags Dec 16 '17 at 13:37

9 Answers9

142

I was getting the following error message:

unable to connect to localhost:4444: cannot connect to localhost:4444
no connection could be made because the target machine actively refused it (10061).

I used adb connect 127.0.0.1:4444 instead and I was prompted with the message instantaneously.

Juan José Melero Gómez
  • 2,742
  • 2
  • 19
  • 36
  • 8
    According to a thread about this on xda, the "Problem stems from systems that resolve IPv6 above IPv4, so localhost becomes ::1: not 127.0.0.1, and ADB clearly doesnt play nice with v6." – Sterling Dec 20 '15 at 20:19
  • 3
    On Windows 10 using Android Studio 1.5 I had to switch to adb connect 127.0.0.1:4444 in order to get the Moto 360 visible – Raffaeu Dec 23 '15 at 08:49
  • Also used adb connect 127.0.0.1:4444 and got message instantaneously – Ika Dec 28 '15 at 19:26
  • 4
    The same problem on OS X El Capitan. This is the correct answer. – igla Jan 22 '16 at 08:13
  • I have this problem from time to time, always forget the solution, and always come back to the same place. I just wanted to say **thank you very much!** – XdrummerXboy Apr 22 '16 at 00:45
  • Worked like a charm! Thank you very much! – McSullivan May 18 '16 at 19:59
17

Try this instead

adb connect 127.0.0.1:4444

more: https://stackoverflow.com/a/35093813/2267994

Community
  • 1
  • 1
Vu Nguyen
  • 301
  • 1
  • 3
  • 10
8

I found the answer

first remove port forwarding;

adb forward --remove tcp:4444

then do port forwarding steps from the begining

adb forward tcp:4444 localabstract:/adb-hub
adb connect localhost:4444

i fixed my problem with these steps

Enes
  • 2,225
  • 1
  • 19
  • 16
3

You can try that, at least, it works for me:

your watch -> developer options -> adb debugging (once disable, then enable).

After that,

adb forward tcp:4444 localabstract:/adb-hub

adb connect 127.0.0.1:4444

elifekiz
  • 1,456
  • 13
  • 26
1

Debugging over Bluetooth was always Off for me. Apparently I had to choose a debugging wearable device here:

Android Wear -> Settings (gear icon) -> Debugging over Bluetooth -> Device to Debug

ViliusK
  • 11,345
  • 4
  • 67
  • 71
1
  • Open the Wear OS app on the Android Phone and Go to Advanced Settings (Lowermost option in app after scrolling).
  • Check that Debugging over Bluetooth switch is OFF. Turn is ON
SimpleGuy
  • 2,764
  • 5
  • 28
  • 45
0

Here is a good collection of commands you might need: commands

I had a different connection problem which where not solved by any suggetions. In the end I found out that adb has a "problem" when 2 mobile devices with bluetooth debugging enabled are connected with the computer - it just connects to the first one, so keep in mind to detach other devices or check by using: adb devices which one was chosen. It is not an issue of adb but of my setup. It did cost some time to figure it out...

Tino
  • 299
  • 3
  • 15
0

I recommend this. If you have a emulator preview connected first go inside Android Wear app to the emulator and choose FORGET.

Later use the commands all are using

adb forward tcp:4444 localabstract:/adb-hub
adb connect localhost:4444

That work for me.

josedlujan
  • 5,357
  • 2
  • 27
  • 49
0

Another solution.

If you have connected the emulator you can see the same problem, just disconnect the emulator or shutdown and later repeat the commands that's all.

josedlujan
  • 5,357
  • 2
  • 27
  • 49