Unable to establish a connection to adb - android-studio

I have problem in android studio when I want to run project that I made on my smartphone or even on Genymotion, anyone know how to fix it?
here the message:
Unable to establish a connection to adb.
this can happen if you have an incompatible version of adb running already.
try re-opening studio after killing any existing adb daemons.

Connect phone to pc in adb mode, open command prompt in folder that contains the necessary adb files. At command prompt type "adb devices" without quotes and press enter. It should kill current daemon and restart adb. Will also show device connected

Related

Can't run app on phone or emulator with Android Studio: adb.exe start-server failed -- run manually if necessary

Some time ago, my android studio got a problem. It can't find my phone. I get this error:
Unable to run 'adb': null
'C:\Users\Gebruiker\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary
When I open the taskmanager I can see adb.exe opened multiple times, but I am unable to force stop it.
I didn't have this problem before. I tried everything I could find on the internet. I deleted and downloaded android studio multiple times, made sure all the files were gone, tried an older version, tried the no .exe installer but none worked.
I also checked the cable and tried another one.
My computer can see my phone because it's listed in the explorer so the problem is with android studio.
EDIT: I tried to run on an emulator, but got the same error and another one:
ERROR: AdbHostServer.cpp:102: Unable to connect to adb daemon on port: 5037
EDIT 2: I downloaded android studio on a different computer and had no errors. I used the same device and usb cable. Everything worked normally so the problem is with my computer.
I hope someone can help me.
I thank you in advance!
I found out the problem. The anti virus software (Bullguard) blocked it. I had bullguard open during launching android studio and a popup asked for permission for adb.exe. I didn't get this popup when I hadn't open android studio and bullguard together.

No connected devices found; please connect a device, or see flutter.io/setup for getting started instructions

i am using the Android Studion 3.3 on Windows 10. i have created a emulator and it is running manually for the AVD manager but when i Click on Run Button the fallowing messageBox sappers
> No connected devices found; please connect a device, or see flutter.io/setup for getting started instructions.
I would try to restart your adb deamon first. Adb is the program that runs in the background to install your application to the simulator. You can do that by using the following command:
adb kill-server
Then you can run adb devices. If should start adb again and if it shows your emulator, it means that the simulator is sucessfully connected to adb, which means you are ready to try to install the application again from Android Studio.
If that still does not work, you can also restart Android Studio and the emulator, which often solves this kind of problems for me. (It's also useful if you run flutter doctor, it will tell you if any devices are connected).

Device emulator-5554 disconnected (with no Emulators on Android Studio)

I get an error while trying to run any app on a physical device.
Device emulator-5554disconnected, monitoring stopped.
Error while Installing APK
It works after trying at least 3 times, but sometimes it gets frustrating.
I tried to delete all the emulators and reinstall Android Studio but it didn't help. and the set deployment target is always flashing like so:
flashing emulator error
In my case it looks like Docker interferes with adb.
I tried restarting Android Studio, adb kill-server && adb start-server, and anything else I could think of.
Then I tried killing all docker containers and quitting the docker app, and everything works nicely again! Edit: Killing the containers is enough
I'm wondering if this is a newly introduced issue in Android Studio/adb/Docker - I updated to AS 3.4 recently, and I don't remember having this problem in the past, but it could have just been a coincidence.
I tried the suggestion but it didn't work, after a few days of work on it, I found out that a vpn software (SoftEther) that I had installed was causing the problem, uninstalling it solved everything.
it seems adb was interfering with a network bridge the software was trying to create.
Try restarting the adb.
Use the following command to restart adb
adb -d kill-server && adb -d start-server
Use command -d for real device and command -e for emulator in case both are connected
Also if that doesnot work clean the project and reset connected emulator.
Run Emulator and wait for the home screen of the Emulator to load
Click Window > Open Perspective > DDMS
In Devices Panel, click on drop down menu > Reset adb
Run project

Could not automate an ADB binary

Anytime I launch my Android emulator on my Kali machine I get an error message saying "Could not automatically detect and ABD binary",what could be the cause and solution and also when I launch my Android studio and I try running my app in the initializing adb part it keeps loading without showing my Android emulator which I already created...Please any suggestions on how to solve this

Android Studio Debugger Port Error - "handshake failed - connection prematurely closed"

When I try to attach the Android Studio Debugger to a process, I get the following error:
Error running Android Debugger (8603):
Unable to open debugger port (localhost:8603): java.io.IOException "handshake failed - connection prematurally closed"
Kudos to whoever spelled prematurely that way.
Anyway, how do I get around this problem?
I'm using Android Studio 1.2.2 on Ubuntu.
This did not help.
The best and one solution for me was just to restart Android Studio.
Before I tried to restart adb server from command prompt or disable and enable adb integration from tools->Android->Check/Unchek the line, unplug and plug device , but nothing helped.
For me these didnt work: Restart Android Studio,adb kill start server, restart phone.
Worked for me: Tools->Android->Disable and Enabled ADB Integration.
On Windows, restarting Android Studio didn't work. I instead killed the "adb.exe" process then retried.
I didn't need to restart my device, only restarting android studio fixed it ( clean your project if needed).
If doesn't work then restart your device.
Maybe you should consider retaining only one device or a emulator, because Android Studio or Intellij IDEA only accept one device or emulator when debugging. It works well for me. I hope this can help.
Restarting the ADB server worked for me:
$ adb kill-server
$ adb start-server
* daemon not running. starting it now at tcp:5037 *
* daemon started successfully *
$ adb devices
List of devices attached
ce0217127216c0220c device
I had to restart both my android device and android studio. That seemed to work for me.
In my case, often the reason is bad USB cable. Just replace another, better USB cable will work.
It shows that your previous debbugger was not closed. You should click stop (red button) to stop your attach previously, and rerun your debbugger. It would attach again

Resources