16

Hi I am new to android I am not able to run adb.exe it gives me below error:

==>adb start-server
adb I  6108  5748 adb.cpp:219] Android Debug Bridge version 1.0.32
adb I  6108  5748 adb.cpp:219] Revision 09a0d98bebce-android
adb I  6108  5748 adb.cpp:219]
adb I  6108  5748 adb_client.cpp:126] _adb_connect: host:version
adb I  6108  5748 sysdeps_win32.cpp:742] could not connect to tcp:5037: cannot connect to 127.0.0.1:5037: No connection could be made because the target machine actively refused it. (10061)
adb I  6108  5748 adb_client.cpp:175] adb_connect: service host:start-server
* daemon not running. starting it now on port 5037 *
Cannot open 'nul': The system cannot find the file specified. (2)
* failed to start daemon *
error: cannot connect to daemon

What does this error exactly mean..?

Cannot open 'nul': The system cannot find the file specified. (2)  

What is this error..?

JDev
  • 171
  • 1
  • 1
  • 4

7 Answers7

25

make sure you have installing your device driver and adb service and is activated USB debugging in android device -> setting -> developer options and must be could to see your device when you connected by USB port ( by this command : adb devices)

so when you connected by USB follow this Commands :

1-stay connect via USB
2-connect to your WIFI network (computer and mobile device both)
3-ping DeviceIP (must be have ping to your device)
4- adb kill-server
5-adb usb
6-adb tcpip 5556
7-adb connect "yourDeviceIP:5556"
8-adb devices (must be see two device names , one of them is by deviceIP:5556)
9-unplug USB cable

then it's Done! and you could to test your app

java acm
  • 1,020
  • 12
  • 24
0

Check this answer which helped me. The issue might be with the latest unstable version of platform-tools.

adb cannot connect to daemon at tcp:5037

Community
  • 1
  • 1
Ajit
  • 339
  • 5
  • 15
0

In my computer, it is releated to Hyper-V, I have to completely disabled it. Then the ports like 5037,5055,8080 and so on are avaliable.

See more on https://petri.com/how-to-disable-hyper-v-completely-in-windows-10, https://www.poweronplatforms.com/enable-disable-hyper-v-windows-10-8/.

DO NOT FORGET bcdedit /set hypervisorlaunchtype off!!!

Donghua Liu
  • 1,776
  • 2
  • 21
  • 30
0

I had faced the same issue and it was because of the antivirus that was not not allowing to connect with my device. So, I deleted the adb.exe from platform-tools and pasted it again. [Please store the adb.exe before deleting]

After doing this, I got a pop-up from my antivirus software asking if it can allow devices to connect. On clicking OK, I got the authentication key from the device. On checking it, I was able to connect successfully.

Dharman
  • 30,962
  • 25
  • 85
  • 135
0

make sure that your real device is on developer mode. I am using Poco M2 Pro and I had enabled it before around 15 day. But today it suddenly turned off developer mode.

-1

it seems your adb is listening in tcpip mode for connecting over wifi..kill the server using adb kill-server..start it again using adb usb

Else also try l-> Go to task manager and kill adb process. ..

rupesh jain
  • 3,410
  • 1
  • 14
  • 22
  • I tried this adb kill-server but it gives me same error `adb I 3440 5400 sysdeps_win32.cpp:742] could not connect to tcp:5037: cannot connect to 127.0.0.1:5037: No connection could be made because the target machine actively refused it. (10061) * server not running *` – JDev Dec 17 '15 at 06:38
  • 1
    yes ti tried `adb usb` as well gives same error. Even I reinstalled Android SDK still gives me same error... – JDev Dec 17 '15 at 06:41
  • Turn off usb debugging on phone and try – rupesh jain Dec 17 '15 at 06:44
  • Ohh strange I have not connected my phone to pc and `adb.exe` is not showing in task manager... – JDev Dec 17 '15 at 06:50
  • what should I do ? Do need to format whole system now ? or any other solution.? – JDev Dec 17 '15 at 13:26
  • @JDev try using another device..Even I faced the same scenario but after performed the steps which I told it started working fine..r u trying to connect the phone via wifi – rupesh jain Dec 17 '15 at 17:27
-3

adb.exe might be corrupted , try to replace these files

ADB.exe
AdbWinApi.dll
AdbWinUsbApi.dll

from the latest SDK Platform-Tools for Windows

Alex P.
  • 30,437
  • 17
  • 118
  • 169
K. Robert
  • 15
  • 3