So I've read nearly every stack overflow answer about this issue, but still no solution. My device keeps getting disconnected. I've switched through 12 wires, I've tried every USB port; nothing. Eclipse keeps dropping the connection. It happens most often when I enter debug mode. Has anyone found a solution to this? Is this a bug in the new update? Seriously, this makes debugging and testing so painful. It slows down my testing by at least 3 times. There has to be a better solution.
First thing I tend to try is the following commands in cmd/terminal
adb kill-server
adb start-server
And lastly,
adb devices
To check the device is connected.
Following that I'd try restarting the device, and perhaps as a last resort uninstall/reinstall it's drivers.
Edit: also, do you have access to another device? In the past I've had issues with specific devices constantly dropping out.
I experience that when my nexus7 2012 kept disconnecting; root cause was the USB3 connection.
Changing to a USB2 port fixed my issues; can you try switching to a lower speed port?
I was having a very similar problem but using Android Studio on OS X. By default Android Studio points to an SDK inside it's application bundle so I changed the SDK location setting to point to another version of the Android SDK I had downloaded manually and this seems to have fixed the disconnection issues I was having.
Instructions for changing the SDK location setting can be found in this answer.
My connected device (an Acer) was working a treat until I rebooted my mac. After the reboot, Eclipse dropped the connection every single time I ran the app. I tried two cables and every port in my iMac but nothing worked. I had to disconnect and reconnect the device for every run (a real pain when debugging!).
What worked for me was to run the app. When the window appeared to choose the device to run on (which was empty), I disconnected then reconnected the device, but before clicking to run, I checked the box (bottom left) to use this device for each run. It now runs every time directly on the device.
a unpowered usb hub did fix the problem for me. it was happening on both my samsung s6 and my sony z5 premium.and both on my pc and my mac. (using android studio).
Use short usb cable. The shorter the length of cable, the more stable the adb connection. I had the same problem for long time. I changed the cable to shorter one and I haven't got that problem anymore.
Related
I am trying to create a React-Native app and I need to connect my device to troubleshoot some issues that only occur on the physical device and not the simulator. For some reason I have never been able to connect my Pixel 2 XL to my PC. I am running Windows 10 and I have tried all of the following.
Enabling developer mode and USB Debugging on my device.
Uplugging and replugging my device 20+ times in a row.
Changing the USB port I am using.
Changing the USB connectivity settings in Developer Options > Default USB Configuration. (Options are: File Transfer, USB tethering, MIDI, PTP, No data transfer) I've tried them all.
Restarting my device while it's plugged in
Downloading the Google USB Driver (in Android Studio).
Restarting my PC when the device is plugged in.
Updating my PC, and updating my device.
Checking Device Manager and trying to update the driver. (So the device used to show up with the yellow warning triangle next to it and trying to update the driver never worked. But now, the device doesn't even show up in Device Manager anymore)
Factory Reset my phone.
Downloaded Media Feature Pack for N and KN versions of Windows 10 (Suggested by the google tech support)(I called them)
I feel like I've tried everything previously addressed in every Stack Overflow question on this issue.
Finally solved the issue. The data cable was the problem. If you have tried all the steps above, and nothing is working, buy a new cable. This one works great and seems very durable for my Pixel 2 X: https://www.amazon.com/gp/product/B01N4OKUB8/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
I had this issue too - my Google Pixel 2 XL is about 9 months old. Was developing an app, so using USB debugging to debug the app as I built it. One day it mysteriously stopped working, though no issues with charging. I tried everything, including using all the different USB ports on my laptop, with no luck.
I eventually gave up and started using the emulator on Android Studio, and since I didn't need data transfer for anything else, I didn't send my phone for repair or anything.
A few weeks later it just started working again, all by itself...
I don't think I did anything to fix it - the moral of the story is, if you don't need it urgently, there's a chance it might just decide to work again!
I have never had an issue debugging in Android until I switched to my current workspace. It happens in both Eclipse and IntelliJ. Previously I had an issue where the phone would hang at the "Waiting to attach debugger" dialog. Somehow I fixed that so the debugger at least attaches to my app.
Now I can set a breakpoint and have the debugger stop at that point. After about 5-10 seconds it disconnects no matter what I do. I'm able to read a few values of variables in memory before everything disappears. My co-worker is able to debug the same app just fine using Eclipse and we haven't been able to figure out what is wrong or different between our workstations (besides me using IntelliJ). We might have different images for our laptops though.
Any ideas? I've had to use Log statements for now but they are just too slow compared to using an actual debugger. I've tried using different USB cables and that didn't make much of a difference. I've gone through the debugger settings and nothing seemed out of the ordinary. Other Q/A's on SO have mentioned the app silently crashing, but I'm ruling that out due to it debugging fine for my co-worker.
I've been having the same problem running IntelliJ IDEA build IC-133.193. I solved the problem with the following actions:
Quit IntelliJ
From a command line kill the adb server with adb kill-server
From a command start the adb server as superuser with sudo adb start-server
Restart IntelliJ
IntelliJ will start the adb server if it detects that it is not running. The key appears to be starting adb as superuser before starting IntelliJ.
[Update] This doesn't always work. The best solution I've found is to start the app on the device and then attach the debugger to the Android process through the Run menu. I haven't had any disconnections using this method.
I have been fighting for a few days with adb not seeing my device. After trying many other posted solutions, I discovered that the issue was with Chrome also trying to connect its debugger to a web view. If Chrome is connected using chrome://inspect, then adb seems to disconnect. Quitting Chrome resolves the issue. Then I can connect with Android Studio and then restart Chrome and reconnect. Hope this helps someone else.
This fixed it for me
Go to Power Options on your computer
Click 'Change plan setting' on your chosen plan.
Click 'Change advanced power setting' on your chosen plan.
Expand 'USB Settings' .
Expand 'USB selective suspend setting' and change it to disabled.
This issue occurs to me when I try to use a USB 3.0 port. Using a USB 2.0 it does not happen.
This happens to me when the cable connection is sensitive.
After connecting my device to my real device (Galaxy S / Android 2.3.3) and lauching the DDMS Heap tab, sometimes the device disconnects and is no longer available as vaild Android target for the Android Device Chooser dialog. Un- and re-plugging the USB cable have no effect, killing the adb server process or shut down eclipse does not either. As my last resort I've to reboot the device and re-connect USB, this seems to work but this approach has a lot wrinkles, if you know what i mean.
Is there a better solution available?!
Thank you!
There is nothing you can do about it. It's a known issue with all Android Phones based on the OMAP chipset.
It's not that the chipset is bad in any way, but it is fact that the USB-OTG device driver from OMAP is buggy. The driver works well until you stress it hard enough. Lots of logcat outputs cause this, as well as ADB debugging.
Disabling and re-enabling the usb-debug fixes the problem for a while. You can even see the USB-driver failing on the kernel-log by calling 'dmesg' on the shell.
As far as I know all OMAP3 and OMAP4 based devices suffer from this driver-bug.
While debugging, my device frequently disconnects from my PC, usually after every debug session. The device still appears in the DDMS list but the status is "offline". The only way to fix it is to reconnect the USB cord, which becomes a pain after doing it 10 times every hour. There are no visible error messages when it happens.
I thought it was a physical connectivity problem with my USB cord or my device, but I recently upgraded to a brand-new Galaxy Nexus with a brand-new USB cord and it still happens. Now I'm convinced it's a software issue.
Is there any reason why my devices goes offline frequently? Are there any programs that are known to interfere with the Android/ADB connection?
Yup, you are right. It seems to be a software issue.I have faced this annoying thing many times, it happens now and then. I think what happens is that the adb's connection with the device/emulator breaks or becomes faulty, so android starts showing the device as offline. To correct this problem. Go to DDMS-->Devices Tab-->Click the option "Reset adb" (which is the last option, on clicking the dropdown arrow) . You will then see some error report in the console, but after a minute your emulator would be ready to be used without problems. I do it all the time and it works. Try this instead of manually plugging/unplugging the device.
Please check this answer https://stackoverflow.com/a/26425489/1200583 that is for mac but maybe is the same for other OSs
I find it faster to just plug/unplug, but doing the following in command-line should do the same thing:
adb kill-server
adb start-server
We feel your pain. In case you're using the command-line, you can do the same thing by typing "adb kill-server".
I was able to fix this problem for good by updating Samsung Kies, which installed an updated driver for my phone. I suggest you try reinstalling any device drivers.
Patiently, try fixing the USB cord by massaging it and reconnect it to the USB hub securly but not to tight. Also, do not connect with too many USB extended cables or hub or the connection between the device and Eclipse IDE will interfere the duration.
And one thing, do tried putting your device and the USB cord to any flat surface (e.g. table) to support the long cable?
I had the same problem with Galaxy Nexus running CM 10.1.
Updating KIES with latest version seems to have fixed the issue.
Connect your device through a powered USB hub. Some machines, including new apple macbooks, do not have enough power in the USB ports causing ADB to constantly disconnect.
If your device is rooted, you can connect it to adb via wifi. This is very comfortable, much more than wired USB. Of course you don't always have a rooted device.
I also faced this issue. Adb disconnect my Android device each time just after installing the app in android device from eclipse. The issue was with my USB Cable. I was using the USB cable of Blackberry Phone. To resolve this issue i just changed the USB Cable with Android's USB cable(The cable that comes with new Android Phone) and every thing started working fine.
If you are running on Mac OS Sierra and Android Studio 2.1.2 or 2.2.0 then just upgrade your SDK-Platform Tools to 24.0.4 and Restart Android Studio. This will fix it.
The following two solutions worked for me.
You can try either of the two or both of them.
Restart device.
Free some internal storage space (Works in most of the cases).
I am developing for android on a linux machine and I have already created a udev rule for android and it works. After a while if I unplug the device and plug it back in again, adb doesn't recognize the device if I run lusb or dmesg to get information about the device. I tried reload the udev rules and it does not work, I even tried to kill the adb process but it still does not work.
Can someone help?
Anyway, thank you.
This appears to be a real problem on linux, at some point in time a device will no longer be seen by the ADB. What I should really say is almost never be seen by the ADB. In my case I have a Samsung Galaxy Tab 10.1 that was given to attendees of Google I/O 2011. My Ubuntu 10.10 development system was working just fine with this device. Sometime near September 19th the ADB stopped seeing the device! In fact there have been breif moments in time when the device was detected by the ADB. What needs to be made clear about the problem that I and I believe pharaoh are having is not the permissions issue where executing
$adb devices
returns ?????????? for a device. The device simply does not show up in the list. One more important fact is that at no point in time has this device not been detected on my Windows based development machines.
It appears to me that the mechanism that the ADB uses to determine if a device on the USB is in fact a adb_device is fragile and some change in either our devices or our development systems has broken this detection.
Due to some reason sometimes adb gets disconnected, so in that case you have to restart the adb.
Go to DDMS->Devices and you will see Reset adb option in View Menu besides Screen Capture option.
I usually have this problem due to I have installed the adb plugin on Chrome. If I close Chrome and re-connect the device, it appears listed with adb. Hope this helps.
I just had this problem as well with my OnePlus 2.
It was working the previous day. I had then set up port-forwarding using the 'device inspector' dialog in Chrome DevTools. It's supposed to be kept open for it to work, so I kept it open in a tab permanently.
The next day when I connected my device via USB, adb devices didn't list anything. I closed the device inspector dialog in my devtools and suddenly adb recognized my device again. I re-enabled port forwarding after this, but my device is stll being detected.
tl;dr: Close your port-forwarding dialog in Chrome DevTools if it had been kept open even after you removed your device.
I've had this happen before. I disable, and then re-enable debugging on the phone (Setting -> Applications -> Development -> USB debugging, uncheck, then re-check) to get it recognized by adb again.
Try adb kill-server to stop the adb and use another command 'adb devices' to restart it. It should work and it should detect your device again. ( For those who can edit my post: any other commands will start the server not just adb start-server, so don't edit without to leave a comment at least)
May be stupid, but I have been had similar problem right now and after an hour I noticed that the problem was that my USB hub, in which such devices are connected, were not actually connected to the PC.
In fact, the USB wire WAS connected, but they may not being doing good contact for some reason, so it failed randomly from time to time.
Same problem here, using mac os. However connected devices are recognized by Android File Transfer application. It all started with S3 phone (rooted), I thought something wrong with the phone, because Nexus 7 (stock) worked as intended. After 3 days of connecting/reconnecting it stopped being recognized by adb too. Tried to perform a hard reset - didn't help.
adb list - empty list
android file transfer - works perfectly
I'll run out of devices soon
Same problem observed on ubuntu, I tried the following and it worked:
Reference: link
Use the command udevadm from the above reference for ex:
"sudo udevadm test --action="SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="[vendor_id]", ENV{ID_MODEL_ID}=="[model_id]" MODE="0666", SYMLINK+="[Device_Name]"" $(udevadm info -q path -n /dev/bus/usb/001/[DevNum])"
This seems to fix some link files and that solved the problem of adb not detecting device after a while.