amnesyc
amnesyc

Reputation: 5371

Android Studio doesn't detect my connected physical devices

The AVD Manager in Android Studio doesn't show my device but adb devices command in teminal shows it. How to resolve my issues ?

Upvotes: 513

Views: 1173086

Answers (30)

BobDoolittle
BobDoolittle

Reputation: 1730

This had been working for me previously (Windows 11), but my device stopped showing up when I plugged it into USB, even though I got a message notifying me of "USB Debugging Connected (tap to turn off USB debugging)".

I tapped the notification, which took me to Developer Options. I toggled USB Debugging off, and then on again. I then got a pop-up saying I needed to confirm permissions. Once I did so, my device showed up again and worked properly.

Upvotes: 0

GreenMarty
GreenMarty

Reputation: 382

Simple alternative to USB -> WIFI

  • usefull eg. when your cable wears down etc.
  • requirement:
    • Android 11+ (API level 30+) for phone
    • In physical device -> develepor's options -> enable debugging over wifi / ADB over network

Non-CLI method

  1. Android studio -> Device manager -> Pair device using Wi-Fi -> wait for QR
  2. In physical device develepor's options -> ADB over network -> scan QR code from Android studio

source: developer.android.com - connect over wi-fi

CLI approach (works better imho)

  1. Physical device -> ADB over networki -> Pair with code -> get ip,port and code eg. 192.168.1.10:36693 823456
  2. Android studio -> Terminal [Alt]+[F12] -> adb pair ipaddr:port -> [Enter] . Use the IP address and port number from above. eg. adb pair 192.168.1.10:36693
  3. Fill in code eg. 823456

source: developer.android.com - wireless over CLI

Upvotes: 0

Raj Narayanan
Raj Narayanan

Reputation: 3402

In my case, enabling USB Debugging in Developer Options solved the problem. Make sure to grant required permissions upon reconnecting the phone.

Enabling Developer Options

Phone settings >> About Phone >> Software Information >> tap Build Number repeatedly.

Optional Steps

Sometimes, the phone is not detected even with USB Debugging on. In this case, tap on Revoke USB debugging authorizations in Developer options. Grant the required permissions on reconnecting the phone.

If it's still not being detected, then toggle USB debugging off and on then grant permissions upon phone reconnection.

Upvotes: 13

Jugal Panchal
Jugal Panchal

Reputation: 1548

After spending some time I found the problem was to enable USB debugging option to on. Just find in your mobile Settings->Developer Option->USB debugging. Just enable it and it works. It might help someone!

enter image description here

In case you do not see the Developer Option then try to enable it first: Depending on your device and operating system, you may need to go to "Settings -> About Device or About Phone -> Software Information", then tap "Build number" seven times.

Upvotes: 61

Tomi
Tomi

Reputation: 3560

On your device:

Go to settings/ developer settings/ allow USB debug mode

If 'allow USB debug mode' option is disabled. Then you might have the device currently connected to your PC. Disconnect the device and the option should now be available

Note: On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.

If it still doesn't help, you can google it with this expression:

How to enable developer options on YOUR_PHONE_TYPE

Just in case it saves anyone 5 minutes of head-scratching, 'Developer options' is now under 'Settings/System & updates/Developer options'

Upvotes: 333

Chintan Shah
Chintan Shah

Reputation: 1764

If your device was working with Android Studio before this issue, then restarting the device can solve the problem.

Make sure to turn on USB Debugging from Developer Options again after restarting.

Upvotes: 3

Dixit
Dixit

Reputation: 13046

For me, Macbook USB C Hub was the issue. I connected the phone directly to Mac USB C port and worked like charm! hope this help!

Upvotes: 1

Yi Xiang Chong
Yi Xiang Chong

Reputation: 764

This helped me. I followed the instructions on the "Troubleshoot Device Connections" located on the AVD Manager Devices dropdown:

  1. Make sure your Android phone is connected via USB to your computer

  2. Go to your Android phone

  3. Go to Settings > About phone > Software information on your phone

  4. Tap Build number seven times

  5. Developer option is now enabled in your phone

  6. Go to Developer

  7. Turn on or enable USB debugging

  8. Allow computer access to phone

  9. Now click on "Troubleshoot Device Connections"

  10. Click Next until you reach "Restart ADB Server". Click on that and restart

Your device should now show on the AVD Manager dropdown list.

Upvotes: 6

genericUser
genericUser

Reputation: 7108

In my case, I had to set up my android to enable USB debugging.

enter image description here

https://developer.android.com/studio/run/device#setting-up

Upvotes: 5

situee
situee

Reputation: 2740

I am using Android Studio 4.0, Android Studio said "Device was detected by ADB but not Android Studio". I tried re-enable "developer option" and "usb debug", re-plugin the usb, but no luck. I restart the Android Studio and it works.

Please try restart the Android Studio.

Hope it could save you some time.

Upvotes: 3

TomCobo
TomCobo

Reputation: 2916

Some cables can not been used for developer mode or transfer file. A solution would be change your cable and don't waste time.

Trendblog post

Edited

Some USB3 ports are causing issues too. Not sure if there is a way to check if the cable/usb works. But there is a way to detect the USB type USB2 or USB3? . If you are using USB3 could be a port issue too.

Upvotes: 133

Jayant Kapila
Jayant Kapila

Reputation: 77

try the following command and reconnect your device, it will show up.

adb kill-server

Upvotes: 0

Dastin
Dastin

Reputation: 4497

UPDATE 2020 Nov 27

One more reason is your cable which might be broken (only charging is available but not debugging). Hence, buy a new one! ^^


Known that "Can't connect a device with Android Studio" is such an annoying issue to newbies, but I'm kind of an old hand at Android for a quite long time. Most of the common methods have been tried:

  • How to turn on developer mode.
  • Forgot to enable USB debugging.
  • Sometimes need to switch USB configuration to Transfer Files.
  • Some subliminal guides on adb commands, which I've never tried, though.
  • Try a new cable. ...

HOWEVER, what works for me is to REVOKE ACCESS again for the computer your device will connect to, namely:

  1. Go to Developer options.
  2. Revoke USB debugging authorization.
  3. Wait a bit for a dialogue to show up and ask your access consent.
  4. Bang, there you go, your device is listed in Android Studio.

Upvotes: 10

William Gatto Filho
William Gatto Filho

Reputation: 33

This is what worked for me:

  • windows 10.
  • Android Studio 4.1 .
  • Samsung galaxy a50.

In Android Studio do this: File – settings – languages and frameworks – flutter . Then point to the spot in your computer where you flutter is stored at, like: C:\Desktop\Flutter for example.

Hope it helps. : D

Upvotes: 0

sifr_dot_in
sifr_dot_in

Reputation: 3593

while doing all this don't forget to increase the sleep time, so that if the device prompts for authentication on the mobile device you know that the connection is succeeded.

Try 1:

  1. Install "microsoft universal c runtime".
  2. Download the file as per your OS (operating system.)
    https://support.microsoft.com/en-in/help/2999226/update-for-universal-c-runtime-in-windows

Installing Google USB Driver from Developersdeveloper.android.com didn't work for me.

enter image description here Try 2:

  1. search "androidmtk" and install driver installer. (restart pc) (check whether device is showing)
  2. Else search "adbdriver" and install driver installer. (restart pc) (check whether device is showing)

Try 3:

  • Check out whether in Android studio's status bar (displayed at the very bottom of window), any message has been shown. Do the changes suggested in the message.

Try 4:

  • Check whether device is shown after changing the connection type (mostly shown on dragging the top bar on home screen).
  • i.e. "Charging only", "Transfer files", "Transfer photos PTP or MTP"

Try 5:

  • Go to Android "Tools menu"->"SDK manager"->
  • Below "Android SDK location" you will see 3 tabs.
  • Out of it click on "SDK tools" and in the list find and tick-mark "Google USB drivers" and install the package.
  • Restart the computer.

Upvotes: 4

nik vid
nik vid

Reputation: 21

Thing which worked for me is is to uncheck the usb debug mode under your mobile setting developer option and allow again it will show the my device option

Upvotes: 0

Changer
Changer

Reputation: 359

Turn on USB debugging and connect the device to PC. Wait until the device gets detected by PC. While connected, turn off USB debugging and turn on it again.

Upvotes: 4

Pradip Tilala
Pradip Tilala

Reputation: 1813

I have recently faced this issue with my new allotted PC by my company That is a Lenovo L450 (with Windows 10 installed) and I am not able to connect my phone (Redmi note3) to use for debugging purpose. My Android device is working fine with my other PC for debugging purpose.

I also tried commands related to the adb and I try to find all possible solutions. Then I go for YouTube help and this video is very useful: https://www.youtube.com/watch?v=7KdH4j7aAPM

Upvotes: 0

beowulf
beowulf

Reputation: 556

I had usb to usbc hub on my macbook pro which was blocking the device somehow, it worked when I connected it directly with the apple usbc to usb dongle.

Upvotes: 0

user2619028
user2619028

Reputation: 320

Especially if you had a connection previously, if you are using some other application that used ADB connection to your phone - close that application. I have Total Commander that has plugin for ADB connection to mobile phone, and that solved my problem.

Upvotes: 1

FooBar167
FooBar167

Reputation: 2901

There are many reasons why Android Studio doesn't see mobile phone.

One of them is a problem with ADB Interface driver. You can check it in your Device Manager:

enter image description here

If you don't have ADB Interface driver, then use this guide to install it for Intel chipset: Installing the Android Debug Bridge (ADB) USB Driver on a Windows Computer.

If you have other, but not Intel, then try to search for the driver on manufacture's web-site.

For Xiaomi phones, turn off MIUI optimization in the very bottom of Developers mode menu.

Upvotes: 2

kakyo
kakyo

Reputation: 11580

My setup

  • Android Studio 3.5.3
  • macOS 10.14.6
  • Android 9 device is connected to Mac with a Belkin USB hub.

When running a Kotlin sample project from Google's Android github repo, there is no configuration, nor devices showing up in the UI.

Solution

  • File > Sync Project with Gradle Files
  • But my internet connection needs a fix, so I had to go to Preferences > System Settings > HTTP Proxy to specify a working proxy.
  • Make sure buildscript{ ext.kotlin_version } runs a more recent version. I had to upgrade it from 1.2.xx to 1.3.xx.
  • Now the project appears to be ready to build (the default emulator Nexus config is now enabled). Rebuild the project for the emulator just to make sure.
  • Then I had to unplug my device from the USB hub and connect it to Mac directly. Now Android Studio sees my device.
  • Plug the device again into the USB hub. Now Android Studio sees my device with the hub, too.

Upvotes: 0

kakyo
kakyo

Reputation: 11580

It's my first time running Android project today through Android Studio since its 2.x version, and I have the same problem. However, this is with the Flutter plugin. I have a workaround for people with similar setup.

My setup:

  • macOS Mojave on MacBook with Type-C-to-USB dongle
  • Android 6.0
  • Android Studio 3.4.1: Android SDK 9.+, 6.0
  • On Mac, ANDROID_HOME is defined, PATH includes all the required tool paths

Observation

  • adb devices gives the correct device info;
  • flutter devices shows correct device info with more details;
  • Android Studio's Connection Assistant shows Android as detected USB device;
  • Toolbar shows <no devices>;
  • AVD manager shows no such a device.

My workaround

  • Open Terminal and cd to my project root;
  • Run flutter run and the app is correctly deployed and runs fine;

After that, my observation

  • Toolbar shows my device name; I can then run everything from toolbar directly, including Hot Reload;
  • USB config on my device automatically switches to PTP from the default MTP;
  • AVD Manager still does not show my device. Shame!

But at least I'm no longer blocked.

Reference:

Upvotes: 1

barlop
barlop

Reputation: 13743

I plugged my phone in and it was detected fine (no need for device manager or anything like that).. but Android Studio wasn't seeing it.

I found it takes two requirements to be met

- PTP (not MTP)
- USB Debugging mode on

For PTP , go to settings..storage..usb connection..PTP (For MTP/PTP , maybe on my nexus it's there, but on my doogee I see it under 'developer options' .. then under networking , above input, it says "select usb configuration")

For USB debugging, settings..about..tap build about 7 times, then a new option appears for usb debugging and you can turn it on.

Added this is also relevant for USB debugging or MTP/PTP being moved https://android.stackexchange.com/questions/213059/where-is-the-mtp-and-ptp-option-in-android-9

Upvotes: 15

Code_Yoga
Code_Yoga

Reputation: 3248

On Windows 7 , the only thing that worked for me is this. Go to Device Manager -> Under Android Phone -> Right Click and select 'enable'

enter image description here

Upvotes: 0

Keshav Gera
Keshav Gera

Reputation: 11244

if your device version in 9 then

Go to SDK Tools and Update Sdk same Version and Intstall Google USB Driver

enter image description here

enter image description here

Upvotes: 4

Robert Rowntree
Robert Rowntree

Reputation: 6289

Env - AS 3.3.2 Linux 4 (ubuntu)

in AS used menu Tools > Create desktop entry 

Desktop file content - ( note the path does NOT include Platform-tools )

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Android Studio
Icon=jetbrains-studio.png
Path=/home/rob/android-studio
Exec=sh -c ' /home/rob/android-studio/bin/studio.sh' 
StartupNotify=false
StartupWMClass=jetbrains-studio
OnlyShowIn=Unity;
X-UnityGenerated=true

Note that the location of SDK.platform-tools 'adb' below will not be found by desktop.PATH above:

 $ which adb
/usr/local/src/android-sdk-linux/platform-tools/adb

On my setup, my symptom was that any terminal would list the device OK but the toolbar button in AS would never show a connected device... "no devices" is all i would ever see when my phone was connected via USB cable.

SOLUTION for me was adding the correct PATH near the top of the file:

 ${AS_HOME}/bin/studio.sh ...

PATH=$PATH:/usr/local/src/android-sdk-linux/platform-tools:/usr/local/src/android-sdk-linux/tools

Upvotes: 0

arjava
arjava

Reputation: 1889

I use the Android version of Nougat API 24, I solved a device problem not detected by replacing the USB cable.

Upvotes: 2

Barry
Barry

Reputation: 606

Since no-one else seems to have mentioned this, I had this problem on Windows 10 and fixed it:

  • by ensuring that ANDROID_HOME was set in the system environments variables and then restarting Android Studio (you may have to log out and log in again / restart explorer.exe).
  • possibly unrelated, but on Windows 10 ensure that the telnet client via Start -> 'features'

Upvotes: 0

Ayush Jain
Ayush Jain

Reputation: 583

In my case There was multiple instance of adb got created. Unplug device from system. Open Task Monitor (Activity Monitor) and check for adb instances. Kill all adb processes. Try to connect device again. It might work.

Upvotes: 0

Related Questions