Please don't mark this as a duplicate question.
When i m trying to run app in emulator or in real device everytime it throws an exception
Unable to connect to adb. Verify that your localhost entry is pointing to ip4 or ip6 respectively Android
For getting solution i dig google and tried the solution using
adb tcpip 5555
adb connect 127.0.0.1:5555
But every time it catch the same exception.
daemon not running; starting now at tcp:5037
adb F 05-03 12:32:21 9776 7156 main.cpp:45] cannot open C:\Users\admin\AppData\Local\Temp\adb.log: Permission denied
This application has requested the Runtime to terminate it in an unusual way.
Advanced help would be appreciated!
Open command Prompt use following commands
adb kill-server
adb start-server
adb devices // it will shows the device id if its connect success
if not showing the device restart android studio and mobile then execute the command again it will work
Finally i found an answer.
There was my silly mistake. While i was set JAVA_HOME path by
C:\Program Files (x86)\Java\jre1.8.0_211\bin
So just i needed to remove \bin. The correct path is
C:\Program Files (x86)\Java\jre1.8.0_211
Further i started Android Studio as Run as Administrator.
First, try running adb.exe in at the sdk/platform-tools. If it's not working then probably your adb.exe is broken. Then you need to download the sdk again or you can replace the platform-tools folder from some another pc. I also face that problem with Android Studio 3.4.
Related
I am stuck in a problem here.
I cannot attach debug using Android Studio 3.5.1.
Its keeping showing me the message "Error running 'Android Debugger (8600)': Unable to open debugger port (localhost:8600): java.io.IOException"
I tried a lot of things like:
adb reset
invalidate
restart windows
reinstall android studio
and none of them works.
And I cannot find Enable ADB Integration on this version.
Anyone knows how to fix it?
EDIT
Debugging with emulator is working with all versions.
Debugging with devices is working only with devices with Android 9.0+
Kill and start adb didn't work.
I dont think its a local problem because its happen with a lot of people here. Its seems to be a project problem
You might check this 3 things:
1.
Youre not running a not debuggable version.
android:debuggable="false" in Android Manifest
2.
In Android studio you re not building a release version
Check in Build variants in bottom left corner.
3.
If nothing works use Troubleshoot device connections
Tools -> Connection Assistant
or older version
Tools -> Troubleshoot device connections
And try out the helper page from google (seems for older versions)
https://developer.android.com/studio/run/device#assistant
Try this:
adb kill-server
adb start-server
adb usb
For linux, e.g., ubuntu: start all commands with sudo like this:
sudo adb kill-server.
its your connection issue, cant find your device DNS.
what is your OS ?
In windows:
you must go to network and find duplicate dns and clear it (Search for
it)
In mac:
you must kill adb or delete that and run a new version
last hit is Update emulator in sdk
.First you need to check your build.gradle(app) file , and ensure that your build is debuggable.
.If debuggable then you need to check adb is working or not in your system, you can
check by just press 'adb' .
if its working then check devices by 'adb devices', it will show all connected devices.
add kill-server then enter and adb start-server
Try this. I have had luck with this approach when I run into problems with adb.
You can check if the device is recognised or not using
adb devices
If it is indeed recognised you may try to kill adb and start it again
add kill-server
adb start-server
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.
After updating my android studio, I am not capable of anymore running applications on my mobile device because of that error.I need this help.
Your adb connection has hanged out. Open a console terminal and write adb kill-server and adb start-server.
Here's how I solved:
I went toC:\Users\\AppData\Local\Android\Sdk and deleted "platform-tools". Afterwards I installed a new "platform-tools": platform-tools_r27.0.1-windows" (I downloaded it here but you may find in another place http://mirrors.zzu.edu.cn/android/repository/platform-tools_r27.0.1-windows.zip)
That means that the new sdks might not be working for me because I am using "compileSdkVersion 27" in gradle
command not execute
Now I am going to command prompt and go to the bin folder under the installation path of Nox App Player, and I input this command: nox_adb.exe connect 127.0.0.1:62001.
You need to find the correct port and use it. I faced the same problem so here is what I did.
Kill the server:
nox_adb.exe kill-server
Now try to connect on any port number, say, 62001:
C:\Program Files (x86)\Nox\bin>nox_adb.exe connect 127.0.0.1:62001
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
unable to connect to 127.0.0.1:62001:62001
Now try to use port 5037 as mentioned in the output above:
C:\Program Files (x86)\Nox\bin>nox_adb.exe kill-server
C:\Program Files (x86)\Nox\bin>nox_adb.exe connect 127.0.0.1:5037
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
connected to 127.0.0.1:5037
It should work fine then.
find the file location of nox and copy-it
write in cmd:
cd and write the location here
and
adb.exe connect 127.0.0.1:5037
people write "nox.adb.exe" but it's
false
Try this :
cd C:\Program Files (x86)\Nox\bin
and
C:\Program Files (x86)\Nox\bin>nox_adb.exe connect 127.0.0.1:5037
I am solving this problem everyday by running vscode first and then running nox. then killing adb.exe process tree by Task manager and then running nox_adb.exe connect 127.0.0.1:62001 (or 127.0.0.1:52001). Doing all these steps several time everyday.
This worked for me:
(xxxxx = port number, i used 62001)
also
Important to include "" (quotation marks)...
"C:\Program Files\nox\Nox\bin\nox_adb.exe" connect 127.0.0.1:xxxxx
Praise be to God, it's finally fixed. I tried all the above solution and none worked, I even tried updating to the latest version before. I guess updating doesn't update all the files.
The issue was the either adb.exe or nox-adb.exe had an issue, it's not the port that's the issue, it's the adb itself, poiting to a null location, it's weird how it got corrupted. replacing the DLLs as mentioned by a different answer didn't work for me, that's how I know it's the adb executables.
Anyways, the solution is to extract the adb.7z file that's in the bin folder and replace the old files, that's it :)
Short answer:
Extract "C:\Program Files\Nox\bin\adb.7z" & replace all
find adb.exe file path, open console and write: C:\Users\petra\AppData\Local\Android\Sdk\platform-tools (it has to be your path to adb file)\adb.exe connect 127.0.0.1:62001 make sure nox is turned on and try this till you see:
* daemon not running; starting now at tcp:5037
* daemon started successfully
connected to 127.0.0.1:62001
Maybe I'm late for this answer but it could be help someone. I faced same problem and trying to connect nox player with studio, with many attempts I finally found perfect cure for this issue. You have to make sure adb version for both android sdk and nox player uses same.
If they are different, then make them same by replacing these files
(adb.exe, nox_adb.exe, AdbWinApi.dll, AdbWinApi_.dll)
of nox player bin folder (C:\Program Files\Nox\bin\Nox\bin) from android sdk (C:\Users\harvi\AppData\Local\Android\Sdk\platform-tools). And that's it nox player now easily connect with android studio.
Note: create nox_adb file from adb.exe from sdk folder.
input this command : nox_adb.exe connect 127.0.0.1:62025
Press Ctrl+Shift+Esc.
Task Manager should open.
Click "More details" from below.
A larger list of apps should appear.
Locate adb.exe select it then click 'End Task'.
Restart Nox or do what #kundan's answer suggests.
When I try to test my Android application with an android emulator as always I now suddenly get an error message. I'm working with Windows 8. So far I tried the following things which unfortunately could not solve the problem:
reinstalling eclipse with android adt
reinstalling java
installing "android studios" first solved the problem but after one day mysteriously also here adb, stopped working with the error message given in the title " ADB not responding ...
furthermore I unsuccessfully tried out some advice from Mr. Google:
Stopping adb.exe via task-manager and restarting eclipse / android studios
"adb kill-server" then "start-server" via command prompt
setting the path to adb.exe as an environment variable
switching off any antivirus or firewall
starting the IDEs as an administrator
updating the IDEs
The only thing I can remember doing which may have destroyed adb on my computer for all times: I connected my motorola smartphone to my laptop and installed the motorola usb drivers but as I said the adb also won't work with the emulator.
Any help would be kindly appreciated. The issue bothers me for more than an entire day now. Maybe someone had similar problems on Windows 8 ?
On OSX helped:
Close Android Studio
Kill all processess using 5037 port
sudo lsof -i |grep 5037
sudo kill PID_NUMBER
Run adb devices from console
adb devices
Meanwhile the emulator is working again. I cannot definetly say what solved the problem. What It could be a combination of two things:
Deleting the hidden ".android" folder under C:\Users...
(Probably there was some malfunctioning automatically created code)
Deleting and recreating the Path variable to the folder with adb.exe ( ...\sdk\platform-tools\;)
Finally it could be a Windows 8 issue which I don't understand.
Try this,
Open a command prompt with administration permission and type
netsh interface tcp set global autotuninglevel=disabled
This worked for me
Edit: Windows only
Kill the adb.exe with a command prompt. Open a command prompt were your adb.exe is located and type
adb kill-server
Maybe HTTP Proxy blocked the localhost 127.0.0.1:5037
If you have config the HTTP Proxy, make sure to exclude the localhost like picture below
Also, port can also be blocked by the firewall and anti-virus firewall, please notice as well.
Try this,
at the prompt try adb kill-server
Start one of your AVDs
at the prompt try adb root
The prompt should say adbd is already running as root.
That should fix it.
In case it helps anyone else, for me the problem was related with the USB hub that the tablet was plugged into on the computer (unplugging the webcam which was in use fixed it).
I got the same error. Don't worry. I have an solution. Go to Task Manager. Kill the process called adb.exe. You will find 2 or 3 processes. Kill all of them. You are done. It will work.
I have the same problems. Verify port 5037 is free and ports 5555 to 5585 are available and never used by another process.
"ADB server sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585"
FROM: http://developer.android.com/tools/help/adb.html
To find out which process is listening on a port on Windows yo can use:
C:> netstat -an -o
FROM: How can you find out which process is listening on a port on Windows?
I had the same problem, here is my simple fix:
-Go to task manager in windows, look for adb.exe, and kill it
-Go to command prompt, and tap adb devices ==> it will automaticaly start adb daemon
I finally just restarted the computer, and that solved the issue for me.
Uninstall HTC Sync. Or disable it somehow.
Try to open adb from command prompt from directory location as <sdk>\platform-tools,
If adb file is missing try to re-install Android SDK with latest version,
And try to run again..
I think issues will solved, by this procedure.
I saw this on a Mac OS X.
I shut down Android Studio and ran adb get-state in the terminal. When I started Android Studio back up, the warning had gone away.
BTW, I did just try restarting Android Studio without any luck. I am sure a restart of OS would have fixed it too.
The same thing with the Asus Sync utility (with the both our Transformer's 700 and 701).
I think there is a USB-port conflict between ABD driver and Sync utility.
Exit from Sync utility resolve the problem.
Looks like this could be caused by a bunch of different issues. This just happened to me because I had my android phone device plugged in for USB debugging, then after a few hours (and multiple android studio/phpstorm restarts) I had to do unplug the device manually. Things started working again after unplugging.
I have faced this problem few days ago. When I opened my task manager it showing me two adb runnig. It may be because of I am using mobogenie for connecting my android phone for debugging application. This problem is because of moboginie and adt port conflict. then I have followed following procedure to sort out this issue.
!) close eclipse
2) Go to task manager and kill all adb processes.
3) Now go to platform-tools in android sdk
4)press shift+right click mouse and select "open command window here" option
5) type
adb kill-server
adb start-server
6)if server sucessfully started then start eclipse and then connect your phone
(Remember dont connect your phone before starting eclipse)
Following works for me every time:
go to File->Invalidate Caches/Restart
select Invalidate and Restart
And, You are good to go.