I am trying to run adb. When I run : \"adb start-server\" it hangs during a while, and then no message.
After that the command \"adb get-state\" receive the answer \
This solution worked for me:
=> Check if adb is running in Task Manager, then kill it. Now Then try to restart it again via following method:
1) Shift + Right click in ...\android-sdk\platform-tools
folder and select Open command window here
2) Use these commands:
adb kill-server
then adb start-server
If this method didn't work and you see something like this in Command window Killing adb...
Then apply following steps:
3) Close eclipse
4) Now kill javaw.exe Java(TM) Platform SE binary
in Task manager
And follow step 1 & 2 again.
It will surely work. :)
At C:\Documents and Settings\userfoo.android there are some android-related files which uninstaller doesn't delete. Although the most of them are used by AVD, and not by ADB, I recommend you to delete it before any "new fresh" install.
Please check your user rights and privileges, and the user "system" privileges, because of in some companies, they are cutted-off to prevent from virus or automated attacks.
The output can be pinned down to transport code:
D("readx: fd=%d wanted=%d\n", fd, (int)len);
while(len > 0) {
r = adb_read(fd, p, len);
if(r > 0) {
len -= r;
p += r;
} else {
if (r < 0) {
D("readx: fd=%d error %d: %s\n", fd, errno, strerror(errno));
if (errno == EINTR)
continue;
} else {
D("readx: fd=%d disconnected\n", fd);
}
return -1;
}
this might mean adb_read()
returns 0 (EOF), while transport tries to read next 4. So, looks like the transport is not being able to read anything but EOF, and simply disconnects. This maybe a USB Driver issue.
Try using Linux, or running commands with root/admin privilege.
Try this,
Open a command prompt with administration permission and type
netsh interface tcp set global autotuninglevel=disabled
This worked for me
Try setting the environment variable ADB_TRACE before starting the ADB server to see if it can provide any clues:
C:\Android\android-sdk\platform-tools>set ADB_TRACE=1
C:\Android\android-sdk\platform-tools>adb start-server
Please include the output in your question.
To solve problem in windows machine, try the following:
ADB stop connecting attached Android device
demon is not running and demon is running on port 5037
first list all processes which are running on port 5037
command: netstat -ano | find "5037"
Output for above command:
TCP 127.0.0.1:52935 127.0.0.1:5037 SYN_SENT 31016
TCP 127.0.0.1:52936 127.0.0.1:5037 SYN_SENT 31016
Kill processes which are running on port 5037 using the following command: taskkill /F /PID 31016
Then, restart the adb server adb kill-server adb start-server
Expected output:
* daemon not running. starting it now at tcp:5037 *
* daemon started successfully *
Typing adb devices
will give you list of devices connected to the adb server