user1357350
user1357350

Reputation: 777

Eclipse - Target "unknown" in Android device chooser

I am using LG-P500. When I try to select it in the 'Android device chooser', Eclipse recognizes the phone but not the target. It says target "unknown". Because of this problem, I can't choose the phone as the Android device.

How can I get Eclipse to recognize the target?

Upvotes: 69

Views: 78871

Answers (30)

Jaka
Jaka

Reputation: 1423

The problem for me turned out to be insufficient rights of adb server.

I run Android Studio through remote desktop (used laptop to connect to a local, more powerful computer). Apparently i didn't have all the privileges when running through remote desktop.

After stopping adb server and restarting it with root privileges solved the problem.

sudo ./adb kill-server
sudo ./adb root

Edit:

Turns out i had to do this just the first time. Since the first time i don't have to do this anymore.

Upvotes: 0

Krunal Shah
Krunal Shah

Reputation: 1436

Go to Settings -> Storage -> Click on Top right menu button -> USB computer connection-> Check Media device(MTP) is enable or not

Upvotes: 3

vanguard69
vanguard69

Reputation: 840

Also try this, On your phone:

  1. Go to "USB computer connection"
  2. Select Connect as "Media Device (MTP)"

Upvotes: 6

flameshimmer
flameshimmer

Reputation: 331

I had the same problem. Turns out my device was prompting a dialog asking me whether I should allow connecting to my laptop or not. After clicking yes this problem went away.

Upvotes: 0

systemaddict
systemaddict

Reputation: 363

(Debugging was already on, USB cable plugged in, fresh restart)

SOLUTION: Switched USB connection from Media Device (MTP) to Camera (PTP). When I did this it the PC installed device drivers, then phone gave me my computer's fingerprint and had a dialog concerning allow device to use USB Debugging. Accept. Device shows up in eclipse. All good.

(On Samsung Note II API 19) Note: it's good habit to always try toggling the USB mode. I don't think it's the act of designating Camera (PTP), but the dialogs that are generated when doing so. Also, I had my phone replaced: I remember seeing this dialog before but not on this phone. Maybe there's an option somewhere to enable it per device?

Upvotes: 0

LARRY the BRAVE
LARRY the BRAVE

Reputation: 11

When the phone is plugged in and the Eclipse window shows the "Unknown" icon...on the phone turn off USB Debugging then on again, it will then ask to allow that computer to connect, and you can say to always let it do so. Then it comes up OK.

Upvotes: 1

Nazia
Nazia

Reputation: 1

I had the same problem, restarting the PC worked for me.

Upvotes: 0

kalyan
kalyan

Reputation: 11

For me it worked by disabling and enabling the USB-Debugging option while ADB is running. Thanks for all the suggestions.

Upvotes: 0

Yash
Yash

Reputation: 5325

Follow these steps, if your device is recognised but the eclipse is stating it as unknown:

->open cmd   
->go to the your android sdk directory --> Go to platform-tools
->adb kill-server
->adb start-server

this will definitely solve your problem :)

If you already installed USB driver and still your device showing as unknown then follow this solution. I had same problem with my MOTO G and this solution works fine for me

Upvotes: 22

Devflovv
Devflovv

Reputation: 485

you need to authorize the device to that computer. I was connecting the phone to my centos VM and kept getting this. I had to kill the adb server and then run it as root user. then you will get the prompt on the phone to authorize machine.

Upvotes: 0

user3856568
user3856568

Reputation: 1

I tried different drivers, turning USB debugging on/off, rebuilding program with lower level API, killing ABD and restarting. Then I saw post on here regarding cable swap. Changed USB cable to Samsung USB cable and worked immediately.

Upvotes: 0

user3821158
user3821158

Reputation: 81

KITKAT 4.4.2+ users, TRY to switch from ART to DALVIK or from DALVIK to ART. :) solved mine.

Upvotes: 0

Imam
Imam

Reputation: 81

One simple trick works fine for me.

  1. Disconnect device from PC
  2. Tap revoke USB debugging authorization in phone setting
  3. Reconnect device to PC
  4. Tap OK for RSA authorization

Upvotes: 8

timv
timv

Reputation: 3366

GALAXY S5

I know this has been answered heaps of times already but if you have a Galaxy S5 then the turn off and turn on of USB debugging works to resolve this problem

Upvotes: 1

IncrediApp
IncrediApp

Reputation: 10363

Had the same problem with an LG phone. Rebooting it (phone) worked for me

Upvotes: 88

David Liu
David Liu

Reputation: 17624

It is because that you didn't allow your phone to be debug by this computer.

Lock your screen, unplug and plug it then unlock screen click allow in the dialog.

Upvotes: 0

a redshaw
a redshaw

Reputation: 11

For this problem I had tried disconnecting/reconnecting the USB cable, toggling on/off the USB debugging and relaunching Eclipse with no effect. Trying a different android device showed exactly the same eclipse errors, with two entries marked 'offline' and after disconnecting the USB connection it still showed one entry while nothing was connected. My problem was solved by rebooting my computer and starting again. Probably ending the adb.exe programme (answer 4) would have done it too in my case.

Upvotes: 1

RaistlinMolina
RaistlinMolina

Reputation: 355

I used to debug w/o problems in my HTC One X, I broke the screen and until they repair it I managed to get an HTC One (M7 I think it's called internally).

I was unable to debug with this same problem, what actually happened is that besides having to follow a weird procedure to make Debug options appear (press 7 times in the firmware version in "About" menu) the phone was showing a message asking me to verify that the computer trying to debug on it was authorized.

I had not seen this behavior before in any the the phones I have used, not sure if this is a new functionality or simply it was not enforced on the other ones.

Upvotes: 0

M4rius
M4rius

Reputation: 1

Had the same problem. Turns out I had changed my USB connection mode from MTP to MSC. Changing it back to MTP solved the problem. Thanx.

Upvotes: 0

Brian Peterson
Brian Peterson

Reputation: 3008

One solution I am aware of is to just turn off and on USB Debugging on your phone. It also happens to solve a bunch of other device-not-recognized kinds of problems.

Upvotes: 65

kahmali
kahmali

Reputation: 557

I tried these suggestions, but unfortunately, nothing worked.

What worked for me was:

  1. close Eclipse
  2. end the adb.exe process (using Windows Task Manager)
  3. restart Eclipse (the device was now recognized in Android Device Chooser)

Upvotes: 5

seekme_94
seekme_94

Reputation: 162

My problem solved by changing the cable. Nothing else worked for me.

Upvotes: 1

Aaron Klap
Aaron Klap

Reputation: 243

Had the exact same problem. Working fine for over two years then all of a sudden this error pops up. The fix for me was running the SDK Manager.exe located here on my machine: C:\Program Files (x86)\Android\android-sdk Turns out I did not have the ability to run on the device with Android operating system 4.2.2, only 4.0.2. After the SDK updated recognition worked perfectly. Turns out my phones operating system was updated and I forgot to update the SDK.

Upvotes: 0

idan
idan

Reputation: 2200

step 1 : rigth click on the project => properties => android => select api level that your device suport.

step 2 : restart your phone

work for me ...

Upvotes: 0

timothyjc
timothyjc

Reputation: 2228

If you cannot select the ok button when choosing a device it probably means you cant do things like adb logcat either in my experience.

I usually kill adb from Task Manager and it starts working. I noticed adb kill-server only sometimes works, and that there are often multiple processes called adb running... not sure if this is a bug or by design.

Upvotes: 0

Jared
Jared

Reputation: 3176

I had this same issue, and I found this post, which fixed it for me.

Just download http://dl.google.com/android/repository/platform-tools_r16.0.1-windows.zip unzip it and replace your "C:\Program Files (x86)\Android\android-sdk\platform-tools" directory with that

Credit goes to hack_on

Here is his post that helped me: https://stackoverflow.com/a/15000565/342497

Thanks! :-)

Upvotes: 0

Anonymous
Anonymous

Reputation: 61

The reason that my SCH-I535 device was not being targeted... is because I had the device plugged into a USB 3.0 port. Once I plugged it into a 2.0, everything began to work properly.

Upvotes: 6

Ponmalar
Ponmalar

Reputation: 7031

Check your device that

USB connected

and

USB debugging connected

or Check the following

The solution was to create a udev rule for the device. See http://developer.android.com/guide/developing/device.html#setting-up for how to setup a udev rule for your specific vendor device.

With the rule in place. Eclipse was able to launch and debug.

enter image description here

Upvotes: 9

CMA
CMA

Reputation: 2818

create a udev rule for your development device.

Upvotes: 0

Anders Metnik
Anders Metnik

Reputation: 6247

Do you have a driver for your phone installed on your computer, eclipse doesn't automaticly come with drivers for phones.

Upvotes: 1

Related Questions