Unable to connect Android Studio to Pixel 2 - android

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

Related

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.

ADB device stuck in "connecting" state

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.

Android Studio does not detect Android device on Windows 10

I am setting up a Android development environment on a new Windows 10 laptop. I have done this many times on other machines with other operating systems, but this is the first time with Windows 10. The problem is that Android Studio cannot detect my device (LG Zone 3) after I connect it via USB. Note that I have previously used this device for development on an Arch Linux desktop.
I have downloaded Android Studio and created several AVDs. I can run my app and tests on those just fine. However, my hardware device is not listed in the selection dialog.
Here are some things I have tried:
Check that the USB drivers are installed.
Restart ADB from the Android Monitor window in Android Studio
Restart ADB from the command line with adb kill-server and adb start-server.
Quit Android Studio and restart it.
Unplug the device, turn off USB debugging, and turn it back on.
Plug device into a different USB port.
Switch device connection settings to Charge Only and then back to MTP.
What other trouble-shooting steps can I follow to get my device to work?
Depending of your device you might be required to install the phone specific drivers.
Also, sometimes it helps if you go to phone Developer settings and uncheck/disable USB debugging and enable it again.
There are few ways to resolve this problem.
Case 1. Enable the USB debugging option in your mobile.
Setting > developer > Check "USB Debugging"
Case 2. Change from MTP to PTP.(sometimes vise versa works)
Case 3. If nothing worked then try to Install PdaNet+ in your system. This Actually worked for me.
If it solved your issue then answer this question in the comment section > Which case solved your issue? it will help the coming people who are facing the similar problem.
Try this also
1.Just change your cable & give try again
2.Uncheck "Tools" - "Android" - "Enable ADB Integration".
3.Re-Install Google USB drivers
GOTO - http://developer.android.com/sdk/win-usb.html#top
Download the driver
Reinstall it
In my case, an LG device, I just downloaded drivers from the lg site, and it fixed the problem without having to fiddle with any settings.
LG site: http://www.lg.com/us/support/software-firmware-drivers
In my case, I discovered that my device was paired via Bluetooth to my Windows 10 machine. This was preventing it from being listed as a portable device keeping it hidden from Android Studio so make sure the two are not paired.

No usb devices or running emulators detected

I tried running my first Hello World app in android studio in my samsung phone, but I got this message even though the phone was connected through usb:
no usb devices or running emulators detected
note: usb debugging is enabled in my phone
How can I solve this problem?
Connecting your device for development. (Preferred and Fast developing option)
Open your phone's setting->developer options and turn on USB debugging. Then connect your device.
Download Google Usb Driver from SDK Manager. Install your device's required drivers on your computer. And connect.
Using emulator(slow process)
Create new android virtual device(AVD) and download required sdk versions.
Run your app on AVD.
Hope it helps!!
you can solve this problem by the following:
1-make sure the oem driver for samsung (SAMSUNG_USB_Driver_for_Mobile_Phones) is installed
2-if you have another usb port,try to disconnect your phone,and reconnect in another usb port
the second solution solved this problem well>>>>>
install the Samsung kies3 and it will work
This happened to me after upgrading Android. I am running a Google Pixel phone. When I did the upgrade, the USB Configuration setting on my phone, apparently, changed from MTP (Media Transfer Protocol) to Charging. I changed it back to MTP and it works now. I upgraded from Android 7.1.1 to 7.1.2.

Android Device Chooser: Cannot Detect Device

I am trying to use my Nexus 4 to run a hello world app. I'm using the Java ADT with Eclipse.
I cannot detect the device.
Nexus 4: Android 4.4.2
Java ADT: build v22.3.0-887826
Windows 7 Professional x64
Java JDK: jdk-7u51-windows-x64
ADB v1.0.31
Project build target is 4.4.2 (API 19). Minimum required version is API 8.
./adb devices shows no devices.
I am in USB debugging mode on the device. I have allowed installation of non-play-store apps.
My computer detects the phone as a media device (MTP), not as a camera (PTP).
I do not get a prompt asking me if I accept an RSA key.
Things I have tried:
Download USB drivers from here: http://developer.android.com/sdk/win-usb.html#top then:
Start > Properties > Device Manager > Portable Devices > Nexus 4 > Properties > Update Driver > Browse > {Download Folder}
I get a popup telling me that the drivers are up to date.
Changing the cable
Changing the USB port
Restarting Eclipse
Restarting the adb server (kill-server > start-server > devices)
Restarting the phone
Restarting the computer
Editing android_winusb.inf, as described here: USB driving on Android - new devices
I have tried everything I've seen on these pages:
http://developer.android.com/tools/device.html
http://androidsecurity.wordpress.com/2013/06/05/install-google-nexus-4-adb-usb-drivers-on-windows-android-studio/
Android Device Chooser -- device not showing up
How do I deploy HelloWorld app to HTC Eris Droid?
EDIT: I tried to enable ADB over wifi. So I installed ADB WiFi off the play store. It needs root permission, so I tried to root my phone using Kingo Root. Kingo Root does not work. It's giving me the message "No Device Connected!". I can transfer files from the device, and it gets detected when I plug it in, so I don't know it what capacity it "is not connected".
EDIT2: I tried to enable ADB over wifi as described here: How can I connect to Android with ADB over TCP?
adb tcpip 5555 gives me "error: device not found". Looks like inability to detect the device is a common failure mode. I suspect that fixing that will let everything else work as intended.
Android debugging via usb can be a bit hit-and-miss. I have one phone that never connects, one that rarely connects, and one that seems to work pretty much every time (I still have to do the 'unplug/replug/restart' shuffle from time to time)
I would suggest investigating WiFi ADB. If it works with your device (not all devices support it) then it'll save you a lot of time in the long term:
Install one of the various WiFi debug apps from the market
Run it and note the IP address and port it gives you
Navigate to where your android sdk platfrom tools are installed (a default Windows install should be C:\Android\sdk\platform-tools
Type adb connect [ipaddress]:[portno] (ex adb connect 192.168.1.100:5555)
If your device supports wifi debugging, it should show up in Eclipse within a couple of seconds, and you never need to do the plug in/unplug/restart shuffle again!
You don't need any third-party application. See this answer and set-up WiFi debugging with ADB.
EDIT:
You don't need root also.
Check my answer here: You should install the correct drivers its really easy by following the steps from the video
Hope that helps! :)

Categories

Resources