94

I am having a slight issue when trying to debug and android app via usb to external device. I keep getting the error "Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse Restart ADB integration and try again Waiting for process:"

I have tried stopping adb.exe in task manager , closing android studio and restarting , taking out the cable and putting it back and going to tools => android uncheck adb intergration then recheck it . All to no avail

Zidane
  • 1,696
  • 3
  • 21
  • 35

23 Answers23

136

This is a problem of ADB connections as sometimes ADB cache a dead connection on your real/virtual device and due to which the port is busy and u cannot connect to it.

The simplest solution to this is RESTART your ANDROID phone that's it.

saksham
  • 3,173
  • 1
  • 21
  • 23
  • 15
    Disconnecting the phone from the cable worked as well. – sud007 Feb 27 '20 at 12:09
  • sud007 Not needed. May have worked for you but different people face this problem under different circumstances. Some phones stop their ports in use when cable is detached but not all. – saksham Mar 02 '20 at 08:39
  • 1
    I do not understand "not needed" as your forced opinion. However, different people have different problems is a correct one. And for the record, there is no specific problem hence, this is just a workaround and not a Solution. – sud007 Mar 02 '20 at 09:01
  • sud007 not needed means no need to disconnect the cable if you work according the above way around. It will work for all phones – saksham Mar 02 '20 at 09:41
  • 1
    i had my device connected over the wifi and adb tcpip 5555 < restarted the connection for me and it worked – Bawa Dec 17 '20 at 18:36
  • Device restart solution workded. Thanks @Saksham – umesh Jun 17 '22 at 11:53
  • Thanks, Bawa! I'm also debugging over wifi, and this is much nicer than restarting the phone or the IDE. – ctd Oct 25 '22 at 21:53
  • I restarted my device and it did not work – John Glen Jan 15 '23 at 00:36
  • Device restart is too much. Disable and re-enable USB debugging on the device is enough – santilod Jul 06 '23 at 00:11
  • 1
    @sud007 Thanks! I have two PC. One notebook was already connected to the Android phone by USB cable. When trying to connect the phone on another PC via WiFi, the warning appears. Finally unplugged cable works. – Weekend Aug 16 '23 at 09:11
47

What worked for me was to disable and re-enable USB debugging on the device.

Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
humblerookie
  • 4,717
  • 4
  • 25
  • 40
19

Following steps resolved this issue to me:

  1. Disconnect the device.

  2. Restart android studio.

  3. Run the project.

Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
Sachin Tomar
  • 215
  • 2
  • 5
18

Simply go to your Android phone developer settings, disable USB debugging, delete all authorizations for USB debugging and turn the debugging on again.

arenaq
  • 2,304
  • 2
  • 24
  • 31
15

First make sure you close any application use ADB , DDMS

like if you open Eclipse with android studio

Second restart your ADB from terminal

adb kill-server
adb start-server
  • in my cmd and in my terminal I typed adb kill-server and I get 'adb' is not recognized as an internal or external command, operable program or batch file. – Zidane May 03 '16 at 12:10
  • @Zidane in the terminal. –  May 03 '16 at 12:10
  • @Zidane if you run this two command then starting `adb` with no error. –  May 03 '16 at 12:18
  • I get that same error in the terminal do you have any other suggestions – Zidane May 03 '16 at 14:11
  • @Zidane in /platform-tools try './adb kill-server' and './adb start-server' – peresisUser Jan 10 '17 at 09:16
  • @Zidane You must add adb to your environment variables path Check online for how to add environment variable based on your operating system – Bahaa KA Jun 20 '21 at 20:33
14

The issue occurs when I open the Android Studio and IDEA together.

Restart the Android Studio does NOT fix the issue

Re-plugin the cable either does NOT fix the issue

Restart the Mac either does NOT fix the issue

Restart the ADB from terminal FIX the issue

adb kill-server 
adb start-server

In this way, you do not need to close the IDEA.

Updated: 2022-09-19

Restart the Android Studio does NOT fix the issue

Invalidate and Restart the Android Studio does NOT fix the issue

Re-plugin the cable either does NOT fix the issue

Restart the Mac either does NOT fix the issue

Restart the ADB from terminal either does NOT fix the issue

Restart the Android device fix the issue.

Francis Bacon
  • 4,080
  • 1
  • 37
  • 48
12

This problem sometimes occur when Android Studio is opened with another IntelliJ Editor. Just close the other IntelliJ Editor.

Wesley Campagna
  • 131
  • 1
  • 3
9
  1. Open USB preferences in your device. Like the image below.

  2. Click another option. (eg:File Transfer)

  3. Click the no data transfer.

If it doesn't work,please try again.

The operations on the android devices are similar.

enter image description here

Jin Wang
  • 671
  • 6
  • 8
9

Just run command adb usb with connected device and try to debug again.

Kapil Soni
  • 119
  • 1
  • 8
6

this may happen when you created two instances of android studio, or else you are using same device in multiple ADB programs, so simply disconnect you device and then open your desired android studio instance and then connect again. now it will work fine.

i also use same method and every time it works.

VaibhavBhosale
  • 275
  • 4
  • 6
  • 2
    You're right, I have this problem while running Android Studio Canary along side the stable version. – AnT Dec 24 '20 at 05:59
6

IntelliJ IDEA (Ultimate, probably also Community) comes with Android plugin. If IntelliJ is started and any project is open and has been compiled (even without any Android code-base) then IntelliJ (apparently) steals the adb-connection from Android Studio. Either close IntelliJ or disable the Android plugin in IntelliJ.

If IntelliJ is open with android plugin, rebooting phone, killing adb etc. are only sporadic and short-time fixes of the problem as IntelliJ steals the adb connection again.

arberg
  • 4,148
  • 4
  • 31
  • 39
4

I resolved this issue by changing the Use USB for settings Go to setting select transfer settings in my case MIDI was selected.

bharat udasi
  • 133
  • 7
2

Go to Airplane mode ON and OFF , After that everything back to normal.

2

There are few ways to recover adb debugging without restarting android device or machine,

  1. try to restart adb connection (adb kill-server && start-server)
  2. try to restart your modem device (Ethernet or Wifi)
  3. try Disable and Enable again Developer option in your android device

When problem still not resolved, consider restarting your device

1

In my case, I had my device connected both via WiFi (with adb tcpip) and USB cable. Disconnecting the USB cable solved the issue.

Alain1405
  • 2,259
  • 2
  • 21
  • 40
1

Quite awkward issue, I think none of the solutions mentioned above worked for me. Ultimately, I had to invalidate caches and restart.

File -> Invalidate caches... -> Select both options -> Invalidate and restart

Radzik
  • 244
  • 2
  • 16
0

For me was Eclipse using DDMS and conflicting with Android Studio, I wasn't using, so I just uninstall it.

If is your case, go to Eclipse > Help > About Eclipse IDE > Installation Details > Select DDMS and Uninstall..

Ronaldo
  • 1
  • 2
0

At times ADB caches a dead connection on device(real / virtual) due to which the port is busy and it is unable to establish a connection.

You can try different ways:

  1. You can kill and restart the server:

    adb kill-server adb start-server

2). Try disconnecting the device(phone) and reconnecting it.

3). Restart your device (phone).

Anubhav
  • 1,984
  • 22
  • 17
0

Slightly different answer, but I'm including it for completeness.

For me Android Studio had frozen as well with the spinning beach ball of death.

  1. I rebooted the emulator (by having it emulate a power-off/restart cycle)
  2. Killed Android Studio (on a Mac by using esc)
  3. Restarted Android Studio.

After that everything was back to normal.

SMBiggs
  • 11,034
  • 6
  • 68
  • 83
0

if you open two Android Studio at the same time (android studio preview),Will be like this

f2A
  • 27
  • 4
0

For me, it works when rebooting the macOS.

Francis Bacon
  • 4,080
  • 1
  • 37
  • 48
0

In Android Studio Version Electric Eel, I get this error. What worked for me:

  1. enter command in terminal: adb kill-server

  2. don't run any other commands

  3. click on "Attach Debugger to Android Process button"

    attach debugger icon

  4. wait for "Waiting for ADB" dialog to finish

  5. done!


if the issue persists:

  1. unplug all devices and terminate all emulators

  2. plug devices back in, and turn on emulators from the "cold boot now" option

    enter image description here

  3. and then try again from the beginning (adb kill-server)

Eric
  • 16,397
  • 8
  • 68
  • 76
-1

A possible temporary work around that may work prove useful for progress sake when intending to debug is to run the app in android studio , then immediately click on run => attach to debugger

Zidane
  • 1,696
  • 3
  • 21
  • 35
  • The scenario you describe is where I encountered this problem. (It wasn't me who downvoted btw) – Chris Sep 16 '21 at 09:59