ADB device stuck in "connecting" state - android

I'm trying to connect my phone to Android Studio to follow up with some app development. I am currently struggling with connecting my phone to the computer properly, as ADB never seems to connect to the device.
When attempting to boot the app on the device, this is what Android Studio tells me in the run console
com.android.ddmlib.AdbCommandRejectedException: device still connecting
Error while Installing APK
Which leads me to think that this is a problem with ADB. So when I run adb devices I get this log:
List of devices attached
5210a780f48b44c5 connecting
It stays in the "connecting" state no matter how long I wait. I accepted USB debugging and file transfer.
When in Android studio, the device is listed as
I'm out of ideas as to how to fix this. I recently updated my phone (Samsung A5) to Android 8.0. This phone connects and debugs fine on my work computer. I tried updating Android Studio, rebooting my computer, installing Samsung drivers, rebooting my phone, revoking debug access, to no avail. I was able to work on this computer a while back but I don't know what changed.
How can I fix this problem so I can debug on my device?
[EDIT]
adb version shows this
Android Debug Bridge version 1.0.40
Version 4797878
Installed as C:\Users\Frederic\AppData\Local\Android\sdk\platform-tools\adb.exe

A friend told me to try to swap ports to a USB 2.0 instead of USB 3.0. After doing so it worked instantly as expected.
[EDIT]
It appears that this has more to do with the capabilities of the motherboard than the version of USB the port is. The opposite might be true for you, or just any other port.

I had the same problem and found that the issue was solved by switching off USB debugging on the device, then switching it on again.

Related

Unable to connect Android Studio to Pixel 2

I'm running Android Studio Arctic Fox 2020.3.1 Patch 2 on my Dell XPS 13-9370 running Linux Ubuntu Ubuntu 20.04.3 LTS and when I try to connect either of my two Pixel 2s via USB, Studio fails to see them. I have USB debugging enabled and have tried setting Default USB configuration to both File transfer and PTP, to no effect. I also tried swapping USB cables and all the other steps described in the Android Studio Troubleshoot Device Connections.
I should mention that I have no problem connecting Studio to my Samsung Tab A running Android 11, or to any of the emulated devices. They all connect just fine. When I plug the USB cable into the Pixel 2s, I don't even get the permission prompt, even after revoking USB permissions.
I've been knocking my head against a wall on this for a couple of days now, trying out every relevant suggestion I've found on Stack Overflow. I used to have no problem connecting my two Pixel 2 devices up until a few days ago. The problem also occurs on the previous version of Android Studio. I thought it might have something to do with several new third-party apps I installed, but I forced stop them, rebooted the device and still the problem remains.
You can hard reset your devices because in some cases that works.
Otherwise, You can use the developer options wirelessly on your phone.
Just read this article for a step by step guide for how to do this.
Use Android device for development wirelessly
are you using same usb cable for other devices in which it is working ?
try this once - open developer option and select 'Select USB Configuration' . make it mtp and also check if usb debugging is turned on.
Instead of doing it with a cable you could do it wireless just install the plugin adb wifi rest all the instructions are given when you will install that plugin.
Android WiFi ADB
Steps to do this(in short)
Connect your device to your computer using a USB cable.
Then press the button picture of a button to be pressed on the toolbar and disconnect your USB once the plugin connects your device over WiFi.
You can now deploy, run and debug your device using your WiFi connection.
NOTE: Remember that your device and your computer have to be in the same WiFi connection.
Sometimes it happens for the USB connector manager of your operating system. You can uninstall the USB connector manager from your OS Device manager and then restart your laptop. I faced this issue several times and this solution worked for me.
Try to install Genymotion Emulator and Launch it first before running your app. I did it and it helped me and i think it will be work

Android Studio connection issue

Am having a problem in connecting my huawei Y7 2018 phone with android studio,each time i try connecting it via the usb option it still doesnt appear on my android studio even after allowing the usb debugging option on and the weird part of it, it connects to other phones.Kindly help to solve this problem.
check for ADB drivers are properly installed n are compatible with your device. Connect your phone to pc n open terminal n-type adb devices check whether your device shows up or not, if not you have to install your device compatible drivers(optional try universal ADB drivers or google ADB drivers).

Android Studio 3.5.2 can't find USB connected device (but found through adb terminal)

The title pretty much says it all: I'm working on an Android Studio (3.5.2) project on my Windows 7 64-bit running laptop, I connect my Samsung J7 (2016) to the laptop through the original Samsung cable but Android Studio simply can't see the device. If I try to do the same on my desktop computer (same Android Studio version but on a Windows 10 64-bit OS) everything works just fine.
Here comes the funny thing: the "adb devices" command shows the device (and I'm 100% sure it's my smartphone since it's the only device connected). The Android Studio toolbar keeps showing "No devices" anyway.
I've spent 3 hours on this and couldn't find a solution. I already tried every suggested solution around the web (stackoverflow.com included), but I achieved nothing:
Disabling/Enabling USB Debug function in the Developer Settings of my smartphone (including revoking USB debugging authorizations)
Running Android Studio as admin (sometimes it solves strange stuff...)
Trying to USB connect through PdaNet+
Android Studio built-in troubleshooting service (re-scanning for devices actually makes me see my smartphone but it's treating it as if it can't be used as a debugging device; anyway the smartphone-computer connection is just fine: I can browse my files and all. Killing and restarting the ADB server does nothing)
Tried connecting both as PTP and MTP
Tried both the Google USB Drivers and the Windows Update drivers (those the computer gets when you first connect the device)
Thanks in advance :)
if you use linux as your PC OS. may be try to install adb will help you..
apt-get install adb
that's work for me.

In Android Studio, app is running on emulator but not in physical device

I am using Android studio 3.4.1, In which my projects are not running in real device. but not having any problem in emulator.
After connecting the usb and i have run the app. then getting this error. after that device is not even listed in the available devices.
error got in logs:
Installation did not succeed.
The application could not be installed.
Installation failed due to: 'device '711KPMZ0603459' not found'
Retry
Retry also not working.
I also tried in Android studio Beta 1 and Beta 3. same problem happening.
can any one help me in this?
FYKI:
1. USB debugging enabled.
Tried USB option for File Transfer, USB tethering, No data transfer.
Tried with different cable as well.
Problem identified only after updating 3.4.1 android studio. Also facing in 3.5 Beta 1 and Beta 3.
Same kind of problem already added in Issue Tracker. https://issuetracker.google.com/issues/122892907
Kill and Restart the adb manually through Terminal using below comments. use cd to go inside platform-tools under Android sdk folder.
./adb kill-server
./adb start-server
PS: Before posting this questing here, i already tried quitting the adb in Activity Monitor (which can be opened from spot light)
Activate USB-Debugging in Developer Options and set your USB options from Charge phone to transmit Data.
Well the mark of your phone is important because in my case i use LG G5 and i could not see my device even after turning on developer mode and enabling debugger options.
I don't know the type of phone you use but you can try my solution.
After turning on USB debugging, go to tethering under the networks sections and turn on USB tethering then try again.
Hope It helps!

Eclipse not detecting android device

Eclipse is not able to detect my android device even though it is connected to my computer. I had it working on my computer earlier, but my hard drive crashed so I had to reinstall/setup eclipse, and now it doesn't work. I have enabled USB debugging. I updated my USB drivers/ android devices. I tried connecting my android phone first, and then tried my tablet, but there was no change. I tried restarting the ADB server. The android project runs on the emulator, but the emulator takes so long to load and is laggy. I did a lot of research on how to fix this, but nothing is working. In my eclipse console it says, "Failed to find an AVD compatible with target 'Android 4.4W'."
if you have root, you can try to use Wireless adb via wi-fi. for this you must install from GooglePlay app like "wireless adb" run it and connect from cmd like this:
"e:\androidSDK\sdk\platform-tools\adb.exe connect 192.168.0.68:5555"
Also i recommend you to install free third-party android emulator BlueStacks, it work very fast! faster then real device connected by usb
For virtual device try Genymotion
For hardware
-first check if your device is connected - adb devices //some serial number should list. If empty, you need to install proper drivers manually.
also check in windows Device manager
Try to disable USB debugging then enabled USB debugging.
Relay! Yeah it's work.

Categories

Resources