159

I previously developped Android apps on Android Studio . Everything works fine.

I work on real device, and Android Studio recognize it without issue.

Suddenly when I exit android studio and disconnect and reconnect my device, it doesn't recognize my device anymore, I have to exit and restart Android Studio.

I can't find a way to "Reset adb" like Android Studio.

I follow the below instruction(Tools->Android->Enable ADB Integration) and enabled ADB,but still below error occurred.

Error:-

enter image description here

I using windows system.

Any help great appreciation.

Yennefer
  • 5,704
  • 7
  • 31
  • 44
RaMeSh
  • 3,330
  • 2
  • 19
  • 31

16 Answers16

347

Open Command prompt and go to

android sdk>platform-tools>

adb kill-server

press enter

and again

adb start-server

press enter

Lakhwinder Singh
  • 6,799
  • 4
  • 25
  • 42
25

open command prompt -> cd to your sdk\platform-tools type below command:

adb kill-server && adb start-server
lucidbrot
  • 5,378
  • 3
  • 39
  • 68
Vrajesh
  • 1,312
  • 19
  • 25
  • When I type the command above i get a message saying " Error running 'zsh: command not found: adb ': Cannot run program "zsh:" (in directory "/Users/username/AndroidStudioProjects/projectname"): error=2, No such file or directory' " – Mogoai Obi Mar 02 '21 at 12:15
17

Most of the answer is for restarting adb server in the command line.

Jiří's answer is the correct answer for this question (to restart adb server IN ANDROID STUDIO), though it's been redesign as shown below.

go to Tools > Troubleshoot Device Connections

ps. you need to hit "Next" two times to find this Restart ADB server button.

enter image description here

Android Device Monitor was deprecated in Android Studio 3.1 and removed from Android Studio 3.2.

Mia
  • 1,226
  • 1
  • 19
  • 29
14

open cmd and type the following command

netstat -aon|findstr 5037

and press enter.

you will get a reply like this :

  TCP    127.0.0.1:5037         0.0.0.0:0              LISTENING       3372
  TCP    127.0.0.1:5037         127.0.0.1:50126        TIME_WAIT       0
  TCP    127.0.0.1:5037         127.0.0.1:50127        TIME_WAIT       0
  TCP    127.0.0.1:50127        127.0.0.1:5037         TIME_WAIT       0

this shows the pid which is occupying the adb. in this 3372 is the value. it will not be same for anyone. so you need to do this every time you face this problem.

now type this :

taskkill /pid 3372(the pid you get in the previous step) /f

Voila! now adb runs perfectly.

Parth Anjaria
  • 3,961
  • 3
  • 30
  • 62
  • Behind corporate port policy expiration and re-gaining port policy again, I had to waste a week figuring out how to make my ADB work. This answer worked for me! – Taslim A. Khan Feb 24 '21 at 20:52
13
  1. Open a Task Manager by pressing CTRL+ALT+DELETE, or right click at the bottom of the start menu and select Start Task Manager. see how to launch the task manager here

  2. Click on Processes or depending on OS, Details. Judging by your screenshot it's Processes.

  3. Look for adb.exe from that list, click on END PROCESS

  4. Click on the restart button in that window above. That should do it.

Basically by suddenly removing your device ADB got confused and won't respond while waiting for a device, and Android Studio doesn't want multiple instances of an ADB server running, so you'll have to kill the previous server manually and restart the whole process.

matrixanomaly
  • 6,627
  • 2
  • 35
  • 58
6

I do not find a perfect way in Android Studio, get the process id and kill it from terminal:

ps -e | grep adb
kill -9 pid_adb
BollMose
  • 3,002
  • 4
  • 32
  • 41
4

Open task manager and kill adb.exe, now adb will start normally

M. Usman Khan
  • 3,689
  • 1
  • 59
  • 69
1

I faced same issue just fallowed some min steps in Android studio:

Manually fallowing steps in android studio

  1. Goto Command promt and in Command promt fallow a android SDK file path "android sdk>platform-tools>" adb kill-server press enter
  2. adb start-server press enter

-------------------------------------------------OR-----------------------------------------------------------------------

  1. Open Command promt and got android sdk file path adb kill-server && adb start-server
PSP
  • 59
  • 8
1

If you are in Android Studio Open Terminal

 adb kill-server

press enter and again

 adb start-server

press enter

Otherwise

Open Command prompt and got android

sdk>platform-tools> adb kill-server

press enter

and again

adb start-server

press enter

Arslan Maqbool
  • 519
  • 1
  • 7
  • 21
0

AndroidStudio:

Go to: Tools -> Android -> Android Device Monitor

see the Device tab, under many icons, last one is drop-down arrow.

Open it.

At the bottom: RESET ADB.

derHugo
  • 83,094
  • 9
  • 75
  • 115
Jiří
  • 415
  • 6
  • 16
0

After reinstalling Android Studio, Is working without adb kill-server

0

Make sure you have "USB debugging" turns on.

I never had this issue with my other devices before. However, today I worked on a device and encountered this issue. Actually took me a while to debug it. Always thought "USB debugging" is on automatically when turning on the "Developer Options". But turns out its device dependent.

enter image description here

Haomin
  • 1,265
  • 13
  • 12
0

Restart adb

Android Studio uses Android Debug Bridge (adb) inside

adb kill-server
adb start-server

e.g.

alex@yoAlex5$ adb kill-server
alex@yoAlex5$ adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
yoAlex5
  • 29,217
  • 8
  • 193
  • 205
0

I'm facing this problem since i have installed another adb server for another software.

So if you are a linux user simply open terminal and type:

killall adb

Mohamed Slama
  • 189
  • 1
  • 3
  • 17
0

A possible solution to your problem could be the following:

  1. Go to ~.android\avd{your_device}.avd

  2. Delete all files with .lock extention

E. C. Theodor
  • 151
  • 1
  • 4
-1

When I had this problem, I wrote adb kill-server and adb restart-server in terminal, but the problem appeared again the next day. Then I updated GPU debugging tools in the Android SDK manager and restarted the computer, which worked for me.

User42
  • 970
  • 1
  • 16
  • 27