no target device found android studio 2.1.1

JavaAndroidAndroid StudioUbuntu 14.04Usb Debugging

Java Problem Overview


i'm using android studio 2.1.1 in ubuntu 14.04.Now my question is,i want to run the program through my phone without emulator. so i chose the target as usb device but whenever i run this,below mentioned error is rasing.

Error running app : No target device found.

i checked my device by using adb devices command in terminal. adithya@adithya-Lenovo-B460e:~$ adb devices List of devices attached 59V8I7HEJJWGGMK7 device

i also tried with selecting of MTP & PTP.but nothing worked out. kindly anyone help me to solve this problem..

Java Solutions


Solution 1 - Java

I already had this problem before.

Choose "Run" then "Edit Configurations". In the "General" tab, check the "Deployment Target Options" section.

In my case, the target was already set to "USB Device" and the checkbox "Use same device for future launches" was checked.

I had to change the target to "Show Device Chooser Dialog" and I unchecked the check box. Then my device appeared in the list.

If your device still doesn't appear, then you have to enable USB-Debugging in the smartphone settings again.

Solution 2 - Java

go to "Run>edit configuration>" and select "Open select deployment target dialog" from deployment target option then run your app it will show you a dialog box you can choose your target device from there, enjoy it.

Solution 3 - Java

trick that works for me when target device not found:

  • click the "attach debugger to android process" button. (that will enable adb integration for you)

  • click the run button

Solution 4 - Java

I have used a different USB cable and it started working. This is weird because the USB cable (which was not detected in android studio) was charging the phone. This made me feel like there was a problem on my Mac.

However changing the cable worked for me. Just check this option as well if you got stuck with this problem.

Solution 5 - Java

On the phone

  1. Have you enabled Developer Mode?

  2. Have you enabled USB debugging within the Developer Tools menu in settings (this menu doesn't appear unless you've enabled Developer Mode)

  3. Do you have a good and securely connected USB cable?

In Android Studio

  1. In Edit Run/Debug Configurations, do you have "Target: USB Device"?

  2. It may help to download the latest version of the USB driver for that particular phone.

It's also helpful to know whether your phone appears as a recognised device at the operating system level. And when in doubt, reboot everything you can think of.

Solution 6 - Java

Note: I had problem on Windows 7 but it might help you as well..

I had problem with android studio detecting my phone(Acer Liquid Zest 4G), tried restarting android studio, switching back and forth between PTP and MTP, OS was able to detect device normally.

So what I did was, in Developer Options i enabled USB debugging, USB connection is in PTP mode, then from phone manufacturer's site (you can find site for your phone here: https://developer.android.com/studio/run/oem-usb.html), I downloaded USB driver for my phone model, installed driver and android studio was able to detect my phone(there was no need for restart).

I will repeat again, you must have USB Debugging enabled in Developer Options, otherwise it won't work. Hope it helps.

Solution 7 - Java

  1. Set up a device for development https://developer.android.com/studio/run/device.html#setting-up

  2. Enable developer options and debugging https://developer.android.com/studio/debug/dev-options.html#enable

Optional

  1. How to enable Developer options and USB debugging
  • Open Settings menu on Home screen.
  • Scroll to About Tablet and tap it.
  • Click on Build number for seven times until a pop-up message says “You are now a developer!”

Solution 8 - Java

After i changed my target to usb. i had to create the file /etc/udev/rules.d/51-android.rules with vendor details .Click for Solution

Solution 9 - Java

If you are using 32-bit ubuntu (my case) then it is most likely that Android Studio has downloaded 64-bit version of adb and fastboot inside your sdk/platform-tools folder. I think you already have installed adb (and fastboot). If you haven't then run these commands in terminal:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot

This will install 32-bit version of adb and fastboot. Now just replace the 64-bit adb and fastboot executable files in sdk/platform-tools with the installed 32-bit versions:

cp /usr/bin/adb <path-to-your-adt-sdk-package>/sdk/platform-tools/adb
cp /usr/bin/fastboot <path-to-your-adt-sdk-package>/sdk/platformtools/fastboot

Now your android studio should be able to run your App in your device.

Solution 10 - Java

I had the same thing on Windows 7 where I had the device properly set and the driver installed, and I was routinely running on the device. Then suddenly I started getting this error every time. I opened the Edit Configurations dialog as described above, switched to an emulator, tried one run, then went to the same dialog and changed back to USB. Then if worked again.

Solution 11 - Java

I had this problem after upgrading from Android Studio 2.3 to 3.0. As simple as it sounds, I actually just restarted my phone to fix it.

My guess is that the adb server on the phone somehow cached something from the previous installation of android studio, maybe a connection object or something, and by restarting the adb server it resolved the issue.

Solution 12 - Java

try with

sudo adb kill-server
sudo devices

or

echo $ANDROID_HOME
sudo $ANDROID_HOME/platform-tools/adb kill-server 
sudo $ANDROID_HOME/platform-tools/adb devices

Solution 13 - Java

  1. If suppose the android device is not getting connected by android studio then download "PDANet+"(for all android devices).

  2. Or also you can do these following steps:

  • Go to Run tab on toolbar of android studio.
  • Then click on edit configuration
  • In General tab there will "Deployment Target Option" click on "Target" and choose "Open select deployment target dialog" and uncheck the checkbox from below.
  • And at last click OK. Finish.

Solution 14 - Java

This happened to me on android studio version 4 after doing an update to the IDE. The "invalidate caches and restart" option fixed it.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAdithyaView Question on Stackoverflow
Solution 1 - JavaJeremieView Answer on Stackoverflow
Solution 2 - JavaBasantView Answer on Stackoverflow
Solution 3 - JavadvrmView Answer on Stackoverflow
Solution 4 - JavaSheshank KodamView Answer on Stackoverflow
Solution 5 - JavaTim CooperView Answer on Stackoverflow
Solution 6 - JavaWhiteSnakeView Answer on Stackoverflow
Solution 7 - JavaNoWarView Answer on Stackoverflow
Solution 8 - JavaAdithyaView Answer on Stackoverflow
Solution 9 - Javautsav_deepView Answer on Stackoverflow
Solution 10 - JavaJonathan StarrView Answer on Stackoverflow
Solution 11 - JavaJosh ChappelleView Answer on Stackoverflow
Solution 12 - JavaLeonardo PinedaView Answer on Stackoverflow
Solution 13 - JavaRakesh JhaView Answer on Stackoverflow
Solution 14 - JavagachokaericView Answer on Stackoverflow