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 "error: protocol fault (no status)"
If I run then "adb kill-server" the answer is "* server not running *"
I am using windows 7. An admin has elevated my rights to local admin, but it did not solve anything.
I used resources monitor to verify if any other app is using the ports of adb, but it is not the case.
on https://developers.google.com/chrome-developer-tools/docs/remote-debugging
the step 3 indicates to "Enable USB Web debugging" under Settings > Advanced > DevTools.
But on my test phone, there is no "advanced" category in the chrome settings. I couldn't find out either what is the version of chrome installed.
Somewhere on the web I saw a suggestion to change the rights of "tmp/android/" to allow read & write for all users, but in C:\Users\me\AppData\Local\Android\android-sdk\temp there is no android folder.
So I am pretty desperate now, any help would be immensely appreciated.
thanks
-olivier
EDIT 1: I could't find "Enable USB Web debugging" because it was "android browser" and not chrome (a bit ridiculous yes). I did not know that. Using another device with a proper chrome installed, I could check the option there, but adb is still crashing at startup.
EDIT 2: I did a wild guess that there was some Write issue with the platform-tools folder.
So I uninstalled everything using the sdk manager, I deleted the whole adt-bundle-windows-x86_64. Then I unzipped it elsewhere, on c:. Strange thing is, when I launch SDKManager.exe, several packages are already marked as installed :
Tools>Android SDK Tools
Tools>Android SDK Plateform-tools
Android 4.2.2>SDK Plateform
Android 4.2.2>ARM EABI v7a System Image
Extras>Android Support Library
I tried deinstall them again, delete the folder, unzip again and re-install, but still same result. It seems that somehow, it is installed wrong, but refuses to uninstall properly. Anyone knows how to force the unistallation ?
EDIT 3 :
output of adb start-server after having used set ADB_TRACE=1
C:\adt-bundle-windows-x86_64-20130219\sdk\platform-tools>adb start-server
system/core/adb/adb.c::main():Handling commandline()
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:version
system/core/adb/sysdeps_win32.c::socket_loopback_client():socket_loopback_client: port 5037 type tcp => fd 100
system/core/adb/transport.c::writex():writex: fd=100 len=4: 30303063 000c
system/core/adb/transport.c::writex():writex: fd=100 len=12: 686f73743a76657273696f6e host:version
system/core/adb/transport.c::readx():readx: fd=100 wanted=4
system/core/adb/transport.c::readx():readx: fd=100 disconnected
system/core/adb/sysdeps_win32.c::adb_close():adb_close: 100(lo-client:5037)
system/core/adb/adb_client.c::adb_connect():adb_connect: service host:start-server
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. :)
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:
Problem
ADB stop connecting attached Android device
demon is not running and demon is running on port 5037
Solution
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
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
I have the same while i was running a java application 'traccar', it works for me after killing this process
I think another process like java web server or java application like "traccar" running on your machine. It works for me after killing these process.
Uninstall Platform Tools in Android SDK Manager
Find and delete all copies of AdbWinUsbApi.dll, AdbWinApi.dll and adb.exe
Reinstall Platform Tools in Android SDK Manager
I can think of a couple of scenarios in which you would encounter this behavior.
(most likely) You're not running adb.exe as a priviledged user. Even though you're set up as a local admin, you're not running this command with elevated privileges. Since the default run->cmd is in normal user mode, this is expected. The following article explains how to run the command prompt as an admin / priviledged user. http://www.howtogeek.com/howto/windows-vista/run-a-command-as-administrator-from-the-windows-vista-run-box/
(less likely) You may need to add adb.exe to the Windows firewall rules. Go to Control Panel -> Windows Firewall, and click on "advanced settings". Then, under "inbound Rules" and "outbound rules", add a rule for adb.exe as a program.
What I did was end the adb.exe on my task manager, restarted Android Studio and then I connected my device again then everything went fine :D
adb was not responding at all for me on Windows 10. Restarting the Android device solved the problem.
Related
I'm having a problem with emulator-5554, it keeps telling me it is offline.
When I do a adb devices from the command line it says
emulator-5554 offline
Even after a fresh restart, I try that command and it still says it is offline.
The problem is when I try to install .apk files to the emulator using abd install <path> from the command prompt, it tells me that it is offline, if I create another device and run that one, then try to install the .apk files, it says I have too many devices connected. So in other words, I can't install my .apk files.
How in the world can I get rid of that damn emulator-5554? I heard that if you do a restart, it should clear all the devices, but that does not seem to be working. It is like it is getting initialized when my computer starts up. Has anyone run into this issue?
Thanks
1 . Simply "Wipe data" to fix this issue.
2 . If it doesn't work, go to emulated device and enable developer options > enable usb debugging
In such a case, you can do all of the following in order to be assured that your emulator starts working again :
Go to cmd and type adb kill-server
Go to task manager and find adb in processes. If you find one, right click on it and click on end process tree.
In eclipse, go to Window>Android Virtual Device Manager, click on the AVD you want to launch, click on start and uncheck "Launch From Snapshot" and then click on launch.
That's it! It will take a while and it should resolve your problem.
The way that Android detects emulators is by scanning ports starting at port 5555.
The number you see in the adb devices list (in your case 5554) will be one less than the port that adb is finding open.
You probably have a process running that is listening on port 5555. To get rid of the "offline" device, you will need to find that application and close it or reconfigure it to listen to a different port.
This solution is for Windows.
(See #Chris Knight's solution for Mac/Linux)
Start Windows Powershell:
Start -> type 'powershell' -> Press ENTER
Run the following command: adb devices
PS C:\Users\CJBS>adb devices
List of devices attached
emulator-5656 host
emulator-5652 host
12b80FF443 device
In this case, 12b80FF443 is my physical device, and the emulator-* entries are garbage.
Per #Brigham, "The way that Android detects emulators is by
scanning ports starting at port 5555.". The port number is indicated after the emulator name (in this case 5656 and 5652). The port number to check is the emulator port number plus 1. So in this case:-
5656 + 1 = 5657
5652 + 1 = 5653
So let's see which program is using these ports. In this case, the ports to check both start with "565". So I'll search for ports in use starting with 565. Execute: netstat -a -n -o | Select-String ":565"
PS C:\Users\CJBS> netstat -a -n -o | Select-String ":565"
TCP 127.0.0.1:5653 127.0.0.1:5653 ESTABLISHED 5944
TCP 127.0.0.1:5657 127.0.0.1:5657 ESTABLISHED 5944
The final field in this output is the PID (Process ID) - in this case it's PID 5944 for both of these two ports. So let's see what this process ID is. Execute: tasklist /v | Select-String 5944. Replace 5944 with the output of the previous command:
PS C:\Users\CJBS> tasklist /v | Select-String 5944
adb.exe 5944 Console 1 6,800 K Running MyPCName\CJBS 0:06:03 ADB Power Notification Window
What a surprise. It's ADB. As noted by other answers, it could be other programs, too.
Now, just kill this process ID. Execute kill 5944, replacing 5944 with the PID in the previous command.
PS C:\Users\CJBS> kill 5944
To confirm that the spurious emulator is gone, re-run the following command: adb devices
PS C:\Users\CJBS>adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
12b80FF443 device
ADB re-starts (as it was previously killed), and it detects no more fake emulators.
From the AVD Manager try the "Cold Boot Now" option in the drop-down. It worked for me!
If you are on Linux or Mac, and assuming the offline device is 'emulator-5554', you can run the following:
netstat -tulpn|grep 5554
Which yields the following output:
tcp 0 0 127.0.0.1:5554 0.0.0.0:* LISTEN 4848/emulator64-x86
tcp 0 0 127.0.0.1:5555 0.0.0.0:* LISTEN 4848/emulator64-x86
This tells me that the process id 4848 (yours will likely be different) is still listening on port 5554. You can now kill that process with:
sudo kill -9 4848
and the ghost offline-device is no more!
On macOS Big Sur and later, use
sudo lsof -i -P | grep LISTEN | grep 5554
to find out the process.
I finally solved this problem,
I had to go to the Developer options from the Settings in the Emulator,
then scrolled down a little, turned on the USB debugging. Instantly my device was recognized online, and I no longer faced that issue. I tried restarting android studio and emulator, killing adb process, but those did not work.
I also had the same issue. I've tried all solutions described here, but they didn't help me. Then I've removed all emulators in the Android Virtual Device Manager and created new ones. The problem was in the CPU/ABI system image configuration of the Android Virtual Device Manager. My Windows10 machine emulator with system image x86 is always offline, where the emulator with system image x86_64 is working fine as expected. Just be aware of this
I solved this by opening my commandprompt:
adb kill-server
adb devices
After starting up, ADB now detects the device/emulator.
In my case, I found some process that makes adb not work well.
You can try to kill some strange process and run "adb devices" to test.
It worked for me:
kill the process name MONyog.exe
Just write
adb -e reboot
and be happy with adb))
Enable USB Debugging into your emulator
Settings > About Phone > Build number > Tap it 7 times to become developer;
Settings > Developer Options > USB Debugging.
That's it enjoy
The "wipe user data" option finally solved my problem. just wipe user data every time you start the emulator. This always works for me!
I use windows 8 x64 , eclipse
open your emulator,
setting --> about emulated device --> click Build number repeatedly-->open developer options --> open USB debuggin
From AVD manager list at the actions dropdown:
Cold Boot Now
restarts it without all pain above.
Do you have bluestacks installed? If you do, the background processes that it runs creates the offline device "emulator-5554".
Go to the task manager and end all the processes with the description of "Bluestacks"
Try this ...
Close emulator if it Running.
Start Emulator again and wait for its online.
enter Command in commandprompt and press ENTER key : adb tcpip 5555
(Make sure that only One emulator running at a time.)
adb -s emulator-5555 emu kill
Press Enter Key....
Done.
check devices by command "adb devices" in cmd.
In my case, I started in 'Cold Boot Now' and clicked on Message to allow the connection.
Did you try deleting and recreating your AVD?
You can manually delete the AVD files by going to the directory they're stored in (in your user's /.android/avd subdirectory).
Go to windows task manager and end process "adb.exe". There might be more than 1 instances of the same process, make sure to end all of them.
on linux or mac the port thats blocked will emulator-id + 1 so 5555 so:
sudo lsof -i :5555
will show you the pid of process that are taking the port (should be the second column) so to kill it:
sudo lsof -i :5555 | awk '{print $2}' | xargs kill
then adb (fake) devices will no longer show on the list
In my case, the emulator was working with Oreo and lower, but not with Pie, and everything I tried seemed to have no effect. What finally worked was updating the emulator to latest (version 28).
I found that the emulation environment comes up as "offline" when the adb revision I am using was not recent. I properly updated my paths (and deleted the old adb version) and upon "adb kill-server", "adb devices", the emulation environment no longer came up as "offline".
I was immediately able to use "adb shell" after that point.
If the emulator is already open or executing it will tell you is offline. You can double check on the Command Line (Ubuntu) and execute:
adb devices
You must see your emulator offline, you have to close the running instance of the emulator (since the port will show as busy) and after that you can run your application. Hope this helps someone.
I tried everything but only this one works for my case:
Use SDK manager, and reinstall the system image.
Android Studio, click Configure, SDK Manager, Launch Standalone SDK Manager,
Check all "Google APIs Intel x86* System Image", "Intel x86 Atom*System Image" and install. Then re-start Android studio.
You might have to reconfigure and wipe the virtual device with AVD Manager, make sure you choose x86 version.
Ensure that your enable ADB integration is marked;
go to Tools>Android>Enable ADB integration .
if doesn't checked , check this option and close your virtual device and re-open it . this worked for me.. good luck!!
In MAC, you can use Activity Monitor utility, since, unlike Linux, we cannot use netstat -tulpn command in MAC. Search for the running instance of the emulator, typically qemu-system-i386. Kill that instance and you will see none of the ghost emulator running.
Simplest way to grab Activity monitor utility is to use spotlight search. just hit cmd-space and type in Activity Monitor.
I had the same issue with my virtual device. The problem is due to the Oreo image of the virtual devices that have the Play Store integrated. To solve this problem I installed a new device without the Play Store integrated and all it was fine.
Hope it helps, Bye
See emulator-5554 unauthorized for adb devices. On API 29 emulator I run adb devices command and got emulator-5554 unauthorized message. Then I created a new avd device from Google APIs image (in my case Q, x86), not from Google Play.
Simply delete and created gear avd again.It will work.
I've been using AS for months, but since two days I get an error when I try to run my app:
Unable to run 'adb': null
'C:\Users\lapof\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary
* daemon not running; starting now at tcp:5037
could not read ok from ADB Server
* failed to start daemon
error: cannot connect to daemon
I've read about a lot of people having this problem, but the solutions provided don't work for me. I read these questions in particular:
Daemon not running. Starting it now on port 5037
Android ADB - Daemon still not running
How to resolve the "ADB server didn't ACK" error?
Eclipse error "ADB server didn't ACK, failed to start daemon"
Adb won't start
How to resolve the "ADB server didn't ACK" error?
Daemon not running. starting it now on port 5037 * Cannot open 'nul': The system cannot find the file specified
A lot of answers to these questions say to close adb.exe from task manager, the problem is that adb.exe is not running and if I try to restart it by typing .\adb start-server on a PowerShell window I get the same error.
I also try to restart my PC but it didn't work.
On the Android device I'm trying to connect to (Samsung Galaxy S8) I enabled USB debugging. I even tried to eliminate all the authorized devices, but nothing worked.
I checked if the 5037 port was used by other processes, but it is used by adb.exe (and the firewall state on that port is allowed and not limited). By the way, as I said, in the task manager adb.exe is not present.
Last I tried to follow the instructions provided in the last question I linked (basically I re-downloaded adb.exe).
Initially I ran .\adb start-server and this strange error occurs:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
** daemon still not running
error: cannot connect to daemon
and then when I try to run my app on Android Studio it occurs this new error when it tries to start adb:
Unable to run 'adb': null
'C:\Users\lapof\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary
ADB server didn't ACK
* failed to start daemon *
and then if I try to .\adb kill-server and then .\adb start-server or .\adb devices or .\adb usb the same error occurs again.
Moreover when I connect my device now it asks me to authorize my PC to connect.
I don't know if this can help, but lately I deactivated a lot of Windows services (but I don't think I deactivated something related to Android Studio).
Details
PC: Compaq
PC OS: Windows 10 Home
Device: Samsung Galaxy S8 (Exynos)
Device OS: Android 8.0
AS version: 3.0.1
The solution which worked for me -
Open Command Prompt as administrator and type
adb start-server
That's it
I had same problem a moment ago. I solved it:
Run CMD as Administrator
Enter adb devices to CMD.
The output for me is :
C:\WINDOWS\system32>adb devices
List of devices attached
* daemon not running; starting now at tcp:5037
* daemon started successfully
P9BCS87ABS9SCD5 device
Usually that's caused by the WinNAT service, restarting which solves the issue.
Just open the Command Prompt or PowerShell as Administrator, and type the following commands there:
net stop winnat
net start winnat
And wait a bit for the Android Studio to reconnect to the ADB.
P.S. If it doesn't reconnect, just type the following commands to restart the ADB:
adb kill-server
adb start-server
I solved the problem on my own.
Out of frustration I opened Control Panel > System and security > Windows defender firewall > Allowed applications and I added adb.exe (both private and public networks).
I came back to Android Studio, ran the app and magically it managed to initialize ADB and my phone connected via USB was there.
I don't really know why this worked, since when I checked in Start > All Programs > Accessories > System Tools > Resource Monitor > Network > Listening Port it said that on port 5037 the firewall was allowed.
Moreover I don't know why up to a week ago all worked fine and now I had to do this process to make it work.
If someone more experienced manages to explain this behaviour better I'll update this answer (or accepts his as best answer)
Run CMD or PowerShell as administrator
Then run the following commands:
net stop winnat
In correct folder run:
adb start-server
net stop winnat
Below solution solved my problem:
Go to your task manager
see if adb is running
right click & end the task
Go to command prompt
run adb devices
it will work fine
For my situation
The latest platform is version 30.0.3. I also have the same problem as this:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
My solving:
Step 1: downloading platform-tool version 28.0.1: https://developer.android.com/studio/releases/platform-tools#2801_september_2018
Step 2: remove platform-tool: go to SDK Manager -> SDK tools
Uncheck "Android SDK Platform - Tool"
Click Apply
Step 3: Going to folder android -> SDK and pass new platform-tool
Step 4: ADB devices.
Then It's working for me.
SDK Manager -> SDK tools
Uncheck "Android SDK Platform - Tool"
Click Apply
After using Android Studio and Emulator without any problems, suddenly it stop to connect to the Emulator, even adb server was running (killing and starting), firewalls raised for all the programs (adb.exe, qemu-system-x86_64.exe, studio64.exe, etc), port 5037 freed, uninstalled and installed again the programs, even the whole Android Studio from scratch. I got verything running OK, but no connection between AS and Emulator.
The solution to my problem was to run Android Studio AS ADMINISTRATOR, it seems that when I updated the program to 3.5.2 somehow the status changed, causing me the problem.
What worked for me in all adb unresolved cases:
adb kill-server
or
adb disconnect
I would just try them both and one will do the trick.
I had this issue several times. It seems if when system is starting, device is connected by USB cable, daemon will connect correctly and no problem will occur. Of course I want a better solution, because it is very hard for me to shut down and start again every time.
Had same issue after upgrading to Android Studio Bumblebee | 2021.1.1
To solve it, go to Settings -> Build, Excecution, Deployment -> Debugger
Then uncheck the option Enable adb mDNS for wierless debugger
I had the same error.
Error on android studio
i use easytether, which was causing the error when is connected.
http://www.mobile-stream.com/easytether/android_faq.html#adbmacosx
After u disconnect it, everything should work fine.
adb port forwarding is not working for me and your insight is appreciated.
The following command is what I am trying
./adb forward tcp:5985 tcp:5984"
I don't see any errors(in logcat) but it just fails silently. When I try the following command
curl localhost:5985 after that, I get "curl: (56) Recv failure: Connection reset by peer"
When I try curl localhost:5984, I do see a message as I have a process running on port 5984 (Couchbase server).
I don't think this is an issue with adb itself as all other adb commands are working. Amongst other things I have tried are
a) kill-server followed by start-server (with sudo mode as well)
b) Restarting my machine.
Needless to say, neither of these have worked. I am working on x64 Ubuntu 11.10.
Please note that I am working with the emulator and my emulator device is running.
I do see other messages in logcat just not this one.
Thanks
-Venu
Have you read this document from Google?
https://developers.google.com/chrome/mobile/docs/debugging
It explains that you have to first make sure you can see your device with
adb devices
Then in Chrome on your Android device, go to Open Settings > Advanced > Developer tools and check the Enable USB Web debugging option as shown here:
Then enter the follow command:
adb forward tcp:9222 localabstract:chrome_devtools_remote
And go to this URL in Chrome on your desktop:
localhost:9222
Does that work?
On the original question , the answer is to make sure your device emulator is running. On Ubuntu you can use: netstat -tan to see the TCP ports that your development machine is listening on. Usually the port is 5554. When the emulator is not started, there will not be a process listening on this port.
Well, I finally got there. I'm not sure which one of these finally fixed the issue (but most are helpful):
ensuring that /etc/udev/rules.d/##-android.rules was chmod a+rw so that we don't need to sudo adb and can edit it again
On Ubuntu 12.04 the ATTRS{idVendor} is the simple 4 hex code (some pages will encourage you to take the full lsusb ####:#### code
I now do not have the SYMLINK+="android_adb" entry in udev
adb devices still shows ???????????? instead of my device code (but works now)
adb shell actually returns a # prompt
adb usb breaks it (it was not returning with curl which I thought was an improvement on the error, but no - it breaks it worse)
There is a bug in adb forward, such that small, fast data connections are simply dropped:
emulator> nc -lk 9998
host> adb forward tcp:9900 tcp:9998
host> date | nc localhost 9900 # Does not arrive at the emulator
host> ( date ; sleep 0.1 ) | nc localhost 9900 # Does arrive at the emulator
That said, when I try the above with curl, that data gets through - presumably because curl holds the socket open in the same way that (date ; sleep 0.1) does.
This issue started happening for me when I updated Android SDK Platform Tools from version 29.0.2 to 29.0.3
I followed this How to downgrade my SDK version?
Basically, you need to downgrade Android SDK Platform Tools to version 29.0.2:
Find your Android SDK folder
Rename platform-tools to platform-tools-29-0-3 (incase something goes wrong)
Download Android SDK Platform Tools 29.0.2 for your machine e.g. http://dl-ssl.google.com/android/repository/tools_r29.0.2-windows.zip
Extract it into your Android/SDK folder
And you are done
After updating the SDK, Eclipse shows this error:
ADB server didn't ACK, failed to start daemon.
When I run an Android application, it gives me the following:
Please ensure that adb is correctly located at 'D:\android-sdk-windows\platform-tools\adb.exe' and can be executed.
How can I fix this problem?
Thanks, #jowett, I have solved my same problem, doing these steps
Step 1:
CTRL+Shift+Esc to open the task manager, which has adb.exe process and end (kill) that process
Step 2:
Now, close the eclipse, which is currently running on my computer.
Step 3:
Again, restart eclipse then solved that problem.
For those using OS X
killall adb
For those using Windows
adb kill-server
should do the trick.
I met same problem, though I didn't what caused this. Whatever, i find some clues and fixed finally.
When I open SDK and AVD manager, but find the AVD version(2.3.3) is not same with android lib version(2.3). So I create a new AVD with 2.3.
I fixed it by the following steps:
1. Open windows task manager and kill adb.exe process.
2. Close eclipse and restart it. Then it works.
Hope it helps.
Command prompt (cmd.exe):
netstat -aon | findstr 5037
Find the process id of 0.0.0.0:
Make sure it's adb.exe:
tasklist | findstr 1980
Kill this process:
taskkill /f /t /im adb.exe
Get ADB back to normal:
Credit: blog post *Android ADB server didn't ACK failed to start daemon*
These symptoms occur if you are using the Genymotion emulator (on Windows or Linux) at the same time as Android Studio:
adb server is out of date. killing...
ADB server didn't ACK
* failed to start daemon *
Genymotion includes its own copy of adb, which interferes with the one bundled in the Android SDK.
The easiest way to fix seems to be to update your Genymotion Settings so it uses the same ADB as your Android SDK:
Just check the "Use custom Android SDK tools" option and enter your desired location.
ADB will often fail if there is a newline in adb_usb.ini. Remove it, restart it, and that will often solve the problem (at least for me anyway).
If you are using a sync application for the device, it could also be because there are other apps using the same 5037 port. Shut down all services running on port 5037 and try starting ADB.
To check if any application is using port 5037, use this:
netstat -a -n -o |findstr "5037"
Get the PID of the application.
Use Process Explorer to find the Process and exit it.
Now use adb start-server or adb get-state to start/check the ADB server status.
I faced the issue when I used the Snappea / Wandoujia Sync application.
I caused this problem by entering an extra blank line at the end of ~/.android/adb_usb.ini
(Removing the extra blank line fixed the problem)
We can solve this issue so easily.
Open a command prompt, and do cd <platform-tools directory>
Run command adb kill-server
Open Windows Task manager and check whether adb is still running. If it is, just kill adb.exe
Run command adb start-server in the command prompt
I have solved my first question: Open Eclipse, open the SDK Manager, and choose the device to open.
Or you can open the SDK directory. Open the SDK Manager, and then choose the device to open
2: Close Eclipse, and then open it.
Make sure USB debugging on your phone is turned on. ADB kill-server and ADB start-server is not the problem.
C:\Documents and Settings\Administrator> adb nodaemon server
- cannot bind 'tcp:5037'
C:\Documents and Settings\Administrator> netstat -aon | findstr "5037"
- TCP 127.0.0.1:1130 127.0.0.1:5037 TIME_WAIT 0
- TCP 127.0.0.1:1269 127.0.0.1:5037 TIME_WAIT 0
- TCP 127.0.0.1:5037 0.0.0.0:0 LISTENING 3088
- TCP 127.0.0.1:5037 127.0.0.1:1128 TIME_WAIT 0
- TCP 127.0.0.1:5037 127.0.0.1:1129 TIME_WAIT 0
- TCP 127.0.0.1:5037 127.0.0.1:1270 TIME_WAIT 0
C:\Documents and Settings\Administrator>tasklist -fi "pid eq 3088"
- Image name PID session name session # memory usage
========================= ====== ================ ======== ============
- adb.exe 3088 Console 0 3,816 K
C:\Documents and Settings\Administrator>taskkill /f /pid 3088
- Success: terminate the PID for the process of 3,088.
C:\Documents and Settings\Administrator>adb start-server
- daemon not running. starting it now on port 5037 *
- daemon started successfully *
I've already up-voted another answer here to this question, but just in case anyone was wondering, you don't need to restart Eclipse to get ADB running again. Just open a shell and run the command:
adb start-server
If you haven't set the path to ADB in your system properties then you must first go to the directory in which ADB exists(in Android\android-sdk\platform-tools....I'm running Windows, I don't know how the mac people do things).
Run over to sysinternals.com and pick up TCPVIEW and PROCESS EXPLORER, if you don't have them installed already.
For some reason, the ADB daemon is terminating before the close socket exchange is complete. If you run (from the command prompt) "NETSTAT -o", you will see the socket (generally 5037) in CLOSE_WAIT state and the owning process number. Process Explorer won't show that process ID (the daemon terminated), and the process called adb.exe (which opened the socket) will be gone. (If adb.exe if found, try killing the task and see if things get cleaned up.)
Using TCPVIEW, locate the hung socket. The process name column will show the associated process can not be found. Right click, and select "Close Connection". The socket is now closed, and the adb daemon should be able to start.
I had a similar issue. Killing an existing instance of the ADB process from Task Manager did not work for me.
Just few days back, I had tried to install MIPS SDK and ADT-17 earlier and Eclipse gave me the error, and I did not fix that issue.
So, now, when I got this ADB server didn't ACK, failed to start daemon... issue, I executed 'Check for Updates' in the Eclipse Help menu item.
There were no updates available, but at least 'ADB server did not ACK' error disappeared.
I hope this might help in a few cases.
Type ./adb nodaemon server in a terminal.
If it returns Invalid content in adb_usb.ini, then there is a problem with your adb_usb.ini file in the .android folder.
Open adb_usb.ini and erase its contents. Then restart the server...it worked for me.
Check for the path of the Android directory. It should not contain spaces, etc.
Also check if the plugin has been properly configured in Eclipse → Preferences.
In my case I had everything checked multiple times, but it was still not working. I was about to reinstall everything, but I came upon an answer on this site (some other post).
Do check your antivirus. It may be blocking the ports of adb.exe or emulator programs, etc. That solved the problem in my case.
In addition to #Bastet's solution:
Actually we have to kill the process using the address 0.0.0.0:0. That's why for most of the people killing adb.exe from Task Manager was working (in my case I was not able to see it even in Task Manager).
Following the #Bastet steps, I found out that some other process was using this address. I went ahead to kill it, and it gave me ACCESS DENIED as Error.
So using the tasklist | findstr **** I found out the name of the process and killed it from Task Manager.
Thereafter it started working.
In my case bas_daemon and bas_helper were using this address both of which corresponds to MOBOROBO.
I had the same problem. But there was no process of adb on my laptop. I just log out and log in to my account, and it's resolved...
ADB could start from CMD windows after that.
The best and the most efficient way without restarting any device or software is:
Run the following:
adt-bundle-windows-x86_64\sdk\platform-tools\adb.exe
And one more thing.. ADB is a self-dependent thing. You cannot do anything until unless it wants itself to work. There is one more way which I found out: Leave the device connected for 5-6 minutes and wait. Soon the device gets connected and tries to launch.
This didn't start happening for me until I rooted my Samsung Galaxy S III phone (following the xda-developer forum guide).
It happens pretty randomly, but it's definitely occurring while running Eclipse.
Killing the adb.exe process and restarting it solves the problem.
Look at the antivirus or firewall... Does any of that block you from access... In k7 antivirus I turned off system monitor, and it does works for me...
Linux/Ubuntu users this might also be the case.... i had an android emulator running and I had to kill that. To do that do the following
lsof -i :5307
(use sudo if needed)
Note the pid in the result of above command. Then
kill -9 <pid_from_above>
then go ahead with
adb shell
I had to allow adb.exe to access my network in my firewall.
Killing Eclipse and then rebooting did not help me. I added the Android tool to the PATH variables, started Task Manager and killed adb.exe.
I restarted Eclipse, and then it worked.
I'm having a problem with emulator-5554, it keeps telling me it is offline.
When I do a adb devices from the command line it says
emulator-5554 offline
Even after a fresh restart, I try that command and it still says it is offline.
The problem is when I try to install .apk files to the emulator using abd install <path> from the command prompt, it tells me that it is offline, if I create another device and run that one, then try to install the .apk files, it says I have too many devices connected. So in other words, I can't install my .apk files.
How in the world can I get rid of that damn emulator-5554? I heard that if you do a restart, it should clear all the devices, but that does not seem to be working. It is like it is getting initialized when my computer starts up. Has anyone run into this issue?
Thanks
1 . Simply "Wipe data" to fix this issue.
2 . If it doesn't work, go to emulated device and enable developer options > enable usb debugging
In such a case, you can do all of the following in order to be assured that your emulator starts working again :
Go to cmd and type adb kill-server
Go to task manager and find adb in processes. If you find one, right click on it and click on end process tree.
In eclipse, go to Window>Android Virtual Device Manager, click on the AVD you want to launch, click on start and uncheck "Launch From Snapshot" and then click on launch.
That's it! It will take a while and it should resolve your problem.
The way that Android detects emulators is by scanning ports starting at port 5555.
The number you see in the adb devices list (in your case 5554) will be one less than the port that adb is finding open.
You probably have a process running that is listening on port 5555. To get rid of the "offline" device, you will need to find that application and close it or reconfigure it to listen to a different port.
This solution is for Windows.
(See #Chris Knight's solution for Mac/Linux)
Start Windows Powershell:
Start -> type 'powershell' -> Press ENTER
Run the following command: adb devices
PS C:\Users\CJBS>adb devices
List of devices attached
emulator-5656 host
emulator-5652 host
12b80FF443 device
In this case, 12b80FF443 is my physical device, and the emulator-* entries are garbage.
Per #Brigham, "The way that Android detects emulators is by
scanning ports starting at port 5555.". The port number is indicated after the emulator name (in this case 5656 and 5652). The port number to check is the emulator port number plus 1. So in this case:-
5656 + 1 = 5657
5652 + 1 = 5653
So let's see which program is using these ports. In this case, the ports to check both start with "565". So I'll search for ports in use starting with 565. Execute: netstat -a -n -o | Select-String ":565"
PS C:\Users\CJBS> netstat -a -n -o | Select-String ":565"
TCP 127.0.0.1:5653 127.0.0.1:5653 ESTABLISHED 5944
TCP 127.0.0.1:5657 127.0.0.1:5657 ESTABLISHED 5944
The final field in this output is the PID (Process ID) - in this case it's PID 5944 for both of these two ports. So let's see what this process ID is. Execute: tasklist /v | Select-String 5944. Replace 5944 with the output of the previous command:
PS C:\Users\CJBS> tasklist /v | Select-String 5944
adb.exe 5944 Console 1 6,800 K Running MyPCName\CJBS 0:06:03 ADB Power Notification Window
What a surprise. It's ADB. As noted by other answers, it could be other programs, too.
Now, just kill this process ID. Execute kill 5944, replacing 5944 with the PID in the previous command.
PS C:\Users\CJBS> kill 5944
To confirm that the spurious emulator is gone, re-run the following command: adb devices
PS C:\Users\CJBS>adb devices
List of devices attached
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
12b80FF443 device
ADB re-starts (as it was previously killed), and it detects no more fake emulators.
From the AVD Manager try the "Cold Boot Now" option in the drop-down. It worked for me!
If you are on Linux or Mac, and assuming the offline device is 'emulator-5554', you can run the following:
netstat -tulpn|grep 5554
Which yields the following output:
tcp 0 0 127.0.0.1:5554 0.0.0.0:* LISTEN 4848/emulator64-x86
tcp 0 0 127.0.0.1:5555 0.0.0.0:* LISTEN 4848/emulator64-x86
This tells me that the process id 4848 (yours will likely be different) is still listening on port 5554. You can now kill that process with:
sudo kill -9 4848
and the ghost offline-device is no more!
On macOS Big Sur and later, use
sudo lsof -i -P | grep LISTEN | grep 5554
to find out the process.
I finally solved this problem,
I had to go to the Developer options from the Settings in the Emulator,
then scrolled down a little, turned on the USB debugging. Instantly my device was recognized online, and I no longer faced that issue. I tried restarting android studio and emulator, killing adb process, but those did not work.
I also had the same issue. I've tried all solutions described here, but they didn't help me. Then I've removed all emulators in the Android Virtual Device Manager and created new ones. The problem was in the CPU/ABI system image configuration of the Android Virtual Device Manager. My Windows10 machine emulator with system image x86 is always offline, where the emulator with system image x86_64 is working fine as expected. Just be aware of this
I solved this by opening my commandprompt:
adb kill-server
adb devices
After starting up, ADB now detects the device/emulator.
In my case, I found some process that makes adb not work well.
You can try to kill some strange process and run "adb devices" to test.
It worked for me:
kill the process name MONyog.exe
Just write
adb -e reboot
and be happy with adb))
Enable USB Debugging into your emulator
Settings > About Phone > Build number > Tap it 7 times to become developer;
Settings > Developer Options > USB Debugging.
That's it enjoy
The "wipe user data" option finally solved my problem. just wipe user data every time you start the emulator. This always works for me!
I use windows 8 x64 , eclipse
open your emulator,
setting --> about emulated device --> click Build number repeatedly-->open developer options --> open USB debuggin
From AVD manager list at the actions dropdown:
Cold Boot Now
restarts it without all pain above.
Do you have bluestacks installed? If you do, the background processes that it runs creates the offline device "emulator-5554".
Go to the task manager and end all the processes with the description of "Bluestacks"
Try this ...
Close emulator if it Running.
Start Emulator again and wait for its online.
enter Command in commandprompt and press ENTER key : adb tcpip 5555
(Make sure that only One emulator running at a time.)
adb -s emulator-5555 emu kill
Press Enter Key....
Done.
check devices by command "adb devices" in cmd.
In my case, I started in 'Cold Boot Now' and clicked on Message to allow the connection.
Did you try deleting and recreating your AVD?
You can manually delete the AVD files by going to the directory they're stored in (in your user's /.android/avd subdirectory).
Go to windows task manager and end process "adb.exe". There might be more than 1 instances of the same process, make sure to end all of them.
on linux or mac the port thats blocked will emulator-id + 1 so 5555 so:
sudo lsof -i :5555
will show you the pid of process that are taking the port (should be the second column) so to kill it:
sudo lsof -i :5555 | awk '{print $2}' | xargs kill
then adb (fake) devices will no longer show on the list
In my case, the emulator was working with Oreo and lower, but not with Pie, and everything I tried seemed to have no effect. What finally worked was updating the emulator to latest (version 28).
I found that the emulation environment comes up as "offline" when the adb revision I am using was not recent. I properly updated my paths (and deleted the old adb version) and upon "adb kill-server", "adb devices", the emulation environment no longer came up as "offline".
I was immediately able to use "adb shell" after that point.
If the emulator is already open or executing it will tell you is offline. You can double check on the Command Line (Ubuntu) and execute:
adb devices
You must see your emulator offline, you have to close the running instance of the emulator (since the port will show as busy) and after that you can run your application. Hope this helps someone.
I tried everything but only this one works for my case:
Use SDK manager, and reinstall the system image.
Android Studio, click Configure, SDK Manager, Launch Standalone SDK Manager,
Check all "Google APIs Intel x86* System Image", "Intel x86 Atom*System Image" and install. Then re-start Android studio.
You might have to reconfigure and wipe the virtual device with AVD Manager, make sure you choose x86 version.
Ensure that your enable ADB integration is marked;
go to Tools>Android>Enable ADB integration .
if doesn't checked , check this option and close your virtual device and re-open it . this worked for me.. good luck!!
In MAC, you can use Activity Monitor utility, since, unlike Linux, we cannot use netstat -tulpn command in MAC. Search for the running instance of the emulator, typically qemu-system-i386. Kill that instance and you will see none of the ghost emulator running.
Simplest way to grab Activity monitor utility is to use spotlight search. just hit cmd-space and type in Activity Monitor.
I had the same issue with my virtual device. The problem is due to the Oreo image of the virtual devices that have the Play Store integrated. To solve this problem I installed a new device without the Play Store integrated and all it was fine.
Hope it helps, Bye
See emulator-5554 unauthorized for adb devices. On API 29 emulator I run adb devices command and got emulator-5554 unauthorized message. Then I created a new avd device from Google APIs image (in my case Q, x86), not from Google Play.
Simply delete and created gear avd again.It will work.