150

I have developed an application and i was planning to deploy it to my HTC Desire. I have installed USB driver. I turned on USB debugging on the phone and choosed charge only when phone plugged-in. When I run application Android device chooser show my device offline. I am stuck at this point. Any help would be appreciated.

I develop at Eclipse Helios on Windows 7 (64bit)

Ahmet Gulden
  • 2,063
  • 2
  • 15
  • 23
  • 2
    **Moderator Note**: There are over 40 answers to this question. Before adding any new answers, please ensure that your solution hasn't already been posted. – Matt Aug 26 '15 at 10:53

34 Answers34

324

I've seen this happen a few times on my HTC Desire. I've never figured out whether the problem is in adb or the device but I usually do the following:

  • Restart adb by issuing 'adb kill-server' followed by 'adb start-server' at a cmd prompt
  • Disable and re-enable USB debugging on the phone
  • Rebooting the phone if it still doesn't work.

99% of my issues have been resolved with these steps.

David Snabel-Caunt
  • 57,804
  • 13
  • 114
  • 132
  • 7
    On my Samsung Galaxy Mini, a mere restart of the device solves this problem for me. – JWL Jan 14 '12 at 09:01
  • 2
    I've got a HTC Incredible S, brand new. The device is not marked 'offline' in the Android Device Chooser, it's just not showing at all! I've already tried with 3 different cables, switched on and off the USB debuggins mode, rebooted the phone many times and nothing works! I can browse the files using Windows Explorer (I got the 'disk drive' option switched on), that works fine, but I can't debug using Eclipse. It works fine with my Galaxy phone and tablet, just not with the HTC. Any ideas? – aeldron Aug 06 '12 at 13:34
  • @aeldron sometimes disabling disk drive option while debugging solves the problem. (at least on Samsung Galaxy S2 phones :P) – Saito Mea Jan 30 '13 at 15:14
  • I would add to that list, restart Eclipse. Seems to work for me sometimes. Not sure why. – Cameron Fredman Feb 18 '13 at 18:06
  • 2
    I needed to a) update my Android developer tools to the latest versions (16.1 and 21.0 as of this comment), and b) remove /usr/bin/adb, which was old and overshadowing the adb executable that gets installed in your Android platform-tools folder. Not sure where /usr/bin/adb came from! – Eric Mill Mar 18 '13 at 20:40
  • 1
    For me it was the `Restart adb by issuing 'adb kill-server' followed by 'adb start-server' at a cmd prompt` that worked – jcaruso Nov 25 '13 at 14:13
  • 1
    When I detach and reattach my usb cable, the problem goes away. Don't know if this is a cable problem or some kind of timeout problem. Any clues ? – Trojan.ZBOT Dec 29 '13 at 01:01
  • Solved by disabling and re-enabling USB debugging on the device. What I found is that there is a prompt there to always "allow USB debugging from this computer". Haven't had this problem since... :) on Samsung Google Nexus S – Tash Pemhiwa Jan 30 '14 at 08:57
  • Change cable before doing any thing. – Sundeep1501 Feb 14 '14 at 06:57
  • "Reset adb" in the Eclipse devices menu (in the DDMS Perspective) worked for me. – IcedDante Mar 29 '14 at 16:19
  • Thanks. Simply doing the first step and then removing and re-connecting the device cable worked for me. – Sarang Oct 15 '14 at 06:16
  • Just my 2c ... same happened to me on my Galaxy Note 3. Just had to restart the device, this made the prompt to reconfirm the fingerprint appear, which before it didn't. – dodgy_coder Oct 30 '14 at 11:24
  • Damn it, I've been over this for hours trying to get my "Virtual Box Android" show up as "connected" on my host. This worked. – Marco Aurélio Deleu Mar 26 '15 at 04:23
  • @Davis Caunt Its happened in Samsung Note 3 too in Android Studio. I have followed this solution. Its working. – Karthikeyan Ve Jun 11 '15 at 08:02
  • "Disable and re-enable USB debugging on the phone" solved the issue for me. thanks – Serdar Samancıoğlu Aug 17 '15 at 07:39
  • This is a temporal solution. For me worked but some time ago I had the same issue. I think the problem is not with the phone, is with the adb (or in the computer side). Any of the solutions here is really fixing the real issue or any description about what is exactly the problem. So this solution is not correct 100% – Juan Pedro Martinez Oct 08 '15 at 12:40
  • Like I said, 99% of my issues were resolved by these steps – David Snabel-Caunt Oct 08 '15 at 13:07
  • Thanks! Worked perfect for my sony xperia z5 – Kaiwen Huang Aug 18 '16 at 10:53
64

I tried everything mutliple times in multiple orders, then stumbled across my particular answer:

Use a different USB cable - suddenly everything worked perfectly.

(Another potential answer for people that I found - make sure there is more than 15mb free space on the device.)

Matt Bond
  • 1,402
  • 12
  • 19
  • The USB cable provided with my Galaxy S device did not work. One I got off eBay did. – Jay Tomten Apr 10 '12 at 14:59
  • the cable worked perfectly for mass storage device. but not for debugging. changing the cable solved the issue. =) – Rahmathullah M May 03 '13 at 12:33
  • bad cable here, switching it worked for me. but i propose that you also check the processes that are listening the port 5037 other than adb. Kill all of them, and restart adb server, your device would be back online. – Yuan Nov 17 '13 at 09:50
  • wow , I couldn't figure that out in a million years all by myself!! thank you – Developerium Dec 26 '13 at 20:18
  • When I detach and reattach my usb cable, the problem goes away. Don't know if this is a cable problem or some kind of timeout problem. Any clues ? – Trojan.ZBOT Dec 29 '13 at 01:01
  • 7
    In my case the cable worked fine, but the USB port was the problem. Switched from USB 3.0 to a USB 2.0 port and it just worked. – David Murdoch Aug 01 '14 at 14:43
  • I could see the device in DDMS, screenshot the device in DDMS, but not have it appear in the list of compatible devices to run, no matter how much I unplugged it or rebooted it. I changed the cable; it instantly appeared. Unbelievable! – emrys57 Nov 12 '14 at 13:46
33

Go to DDMS->Devices->Click on View Menu Down arrow on right side -> select "reset adb" option it will work

In Android Studio: open the Android Device Monitor (Tools->Android) and click on the arrow on the 'Devices' tab to reset the adb

reset adb

Fortega
  • 19,463
  • 14
  • 75
  • 113
Jaya
  • 999
  • 11
  • 8
  • 1
    Worked for me- much more succint than the top voted answer. Thanks – IcedDante Mar 29 '14 at 16:18
  • 1
    how do I do this in Android Studio? – Janus Troelsen Jan 24 '15 at 15:44
  • After this step, it wrote me unautorized, Then I have restarted my phone (ASUS zenfone 5), it asked me, to allow connection, When I allow, device became online, thanks a lot – GGSoft Jul 24 '15 at 09:21
  • It happened to me when I connected the same phone to dual booted Ubuntu on the same physical machine. This worked for me, the phone asked for authorization of the computer fingerprint. Interestingly on Windows it just connected – comodoro Jul 04 '17 at 15:54
12

Faced same problem in Windows with Nexus 7 device.

Simply killing adb.exe process from Task Manager solved my problem.

Mostafiz Rahman
  • 8,169
  • 7
  • 57
  • 74
7

I had the same problem several times - just rebooting solves this.

ronen
  • 1,460
  • 2
  • 17
  • 35
6

I also had a smilar problem, I had Samsung galaxy S (GT I9000). I had the drivers installed but the phone showed offline in Android Studio.

Restarting the device while connected to PC solved the issue.

dmSherazi
  • 3,743
  • 5
  • 37
  • 62
5

Updated the Android SDK platform tools using SDK Manager (in Eclipse). Works for me.

Peter Cheung
  • 51
  • 1
  • 1
4

I had the same issue and i solved it by resetting the adb on eclipse.

on eclipse Go to:

DDMS(top right corner) -> Devices -> reset adb

mnaa
  • 416
  • 4
  • 12
3

I can't say for sure but after hours of random disconnections from my device (especially when trying to debug anything), I switched to a USB port that is NOT USB3.0 and that seem to solve the issue.

Muzikant
  • 8,070
  • 5
  • 54
  • 88
  • 1
    Oh wow, I unplugged my USB extension cable and plugged it in directly and it works. Of course, what I have is no longer a "mobile" device, which is what I was trying to test with... – 1j01 Jun 21 '15 at 23:12
  • I switched the USB cable from a port on the hub to a port directly on the machine (MacBook) and that solved the problem, when none of the steps in the accepted answer did. All my USB ports are 3.0, I believe. – LarsH Oct 28 '16 at 13:33
2

I fixed it by deleting unwanted applications/games from my device--make sure there is more than 15mb free space on the device.). It will work :)

2

I was trying to use a Nexus 10 to debug through eclipse. I've been struggling to get eclipse to recognize it. Finally I tried 'adb kill server' / 'adb start server' command, which at least got Eclipse to show the device, although still only offline.

Then I tried switching USB connection to one in the back of the PC, and it worked!

Note: after I switched to rear USB port, I was prompted on the Nexus to allow debugging from my PC, once I allowed, the app popped up.

PLNech
  • 3,087
  • 1
  • 23
  • 52
Jaxon
  • 41
  • 1
2

I had the same problem with my Galaxy S4, when connected to a Win 7 64 machine, not showing up as an available device in Eclipse. Tried rebooting phone, starting/restarting adb, switching from usb 3 to usb 2 port... none of which helped. Downloaded Samsung drivers from here: http://www.samsung.com/us/support/owners/product/SGH-I337ZWAATT

installed drivers and then when I reconnected my phone, windows installed the new drivers (took a min or so). I then restarted Eclipse and was able to see the phone and run the app.

I also tried this with the usb 3 port and it works as well.

Chuck
  • 21
  • 1
2

I had a similar problem in Android Studio 0.2.2 (IntelliJ). On Windows 7 my Nexus 7 did not appear in device chooser although it was fine on my Mac. I could also browse my Nexus 7 in Windows Explorer.

In the end I needed to install the Asus USB drivers for the Nexus 7 (link):

After that ADB detected my Nexus and everything worked as expected.

Daniel Vaughan
  • 666
  • 1
  • 5
  • 14
2

Happened to me with a Motorola MZ 601 (Xoom). I tried everything suggested in other answers, but the only thing that fixed the issue for me in the end was to use a different USB port. Mind you, the same device had been connected to the other USB port before and it worked. So, if all else fails, consider using a different port.

Chrissi
  • 1,188
  • 10
  • 9
2

I have a Windows 7 desktop with a Google Nexus 7 connected to that. I also had the 'offline' problem. Mine is resolved by revoking any previous authorization on Nexus. So now I get the prompt to authorize on Nexus--I am not saving the authorization for now at least--and I allow the authorization--and voila!--Android SDK correctly shows the device as 'asus-nexus_7-xxxx'. HTH

IrfanClemson
  • 1,699
  • 6
  • 33
  • 52
2

I was having this problem and solved by activating the PTP Connection

This option will appears when you connect you cable into your phone. Then you'll see a prompt which will ask you how to you want to you your USB.

"Use USB for" :

Transferring media files Transferring images Connecting MIDI devices Charging

I chose the second option (Transferring images). So, my phone has changed to ONLINE mode

2

I have HTC wildfire and disabling and enabling the debugging worked fine for the "offline" problem. The error does not show up.

However I ran into a new problem when trying to import a python file with sl3a : "no moduled named android" explained here. That being said, I still cannot run this android.py file located somewhere on the SD Card/python folder. I can connect with androidscreencast.jnlp and it works fine :)

Abdul Rahman
  • 2,097
  • 4
  • 28
  • 36
valim
  • 21
  • 3
1

I found that my Pantech Burst had a problem similar to what you all described. After reading through many such posts everywhere I noticed many people reported having to use a USB cable that they got else where other than the phone manufacturer. What I decided to do was use a different USB port on my PC and the problem was fixed. My Pantech Burst does not go offline in the middle of a debug session any more. The port I used to use was the front port on my box, but it was wired to the motherboard without shielding inside the box. Now I use the port on the back of the box that is directly attached to the motherboard.

user574771
  • 999
  • 2
  • 10
  • 20
1

Had the same issue on my HTC Incredible S. The problem was that I used a third party docking station to connect. Connecting the phone directly solved the problem.

Fabian
  • 301
  • 3
  • 7
1

I'm running JellyBean. I noticed for the first time that there is a "Developer Options" slider at the top of the Developer Options menu. Note that I'm not talking about the USB Debugging checkbox - which is a different option. I slid the Developer Options checkbox to "on" and was back in business. Unfortunately, I'm not sure if this is the whole story because I also ran the adb kill/start commands that David Caunt pointed out above.

BradT
  • 481
  • 4
  • 9
1

I have your same problem. I tried all the solutions I found on this site. At the end I found out that my PC front USB is the cause of the offline state of my phone. I know it's dumb :) but switching the USB cable from a front USB port to a back one worked for me.

1

Did you accept the fingerprint for your computer on the device ? When you attach your PC a prompt will be displayed on your phone/device to add this fingerprint/token and trust it.

mpjjonker
  • 917
  • 1
  • 6
  • 28
1

I'm on OSX and have a macbook retina. Switching the USB port that my device was plugged into, for some reason, fixed my issue.

Sig Myers
  • 371
  • 3
  • 13
1

I get the "Device offline" error a lot when debugging via wifi. Whenever I want to go back to debugging with usb, I have to type adb usb, but this command only works if the device is connected to adb via wifi; if the device loses connection for some reason, then it has to be restarted, which is a pain. Simply resetting ADB doesn't solve this issue either.

To work around this, I downloaded an adb terminal application from Google Play: https://play.google.com/store/apps/details?id=jackpal.androidterm&hl=en

I then open up the terminal application on my device while my device is connected to my computer via USB, and type in:

adb kill-server
adb start-server
adb usb

I then unplug and replug my device from my computer, after which the issue is fixed. No annoying device restart needed!

JustSoAmazing
  • 747
  • 4
  • 8
1

On the Galaxy Note 3 in debugging mode with Windows 7 I had problems with the device "offline" in the Android ADT (Eclipse) DDMS "Devices" window. By selecting USB 3.0 as USB connection in the Note 3 pull down control panel the device came online. Obviously applicable for a computer with USB3 ports.

1

Removing the USB cable for about 5 seconds and reconnecting also solves the problem. Maybe you have to try one or two times.

George
  • 6,886
  • 3
  • 44
  • 56
1

This was the solution for me. Connect as you would to debug via wifi:

Make sure your phone is connected by usb. Then open your command prompt as admin and navigate to YourAndroidSdkLocation\platform-tools, and do:

adb tcpip 5555
adb connect YOUR_DEVICE_IP

At this point my device successfully came online, giving me the option to debug via both usb or wifi.

Jordan
  • 78
  • 8
1

Mine was offline.

I unpluged and pluged again but with the mobile awake, a window opened asking permission.

So try to plug and unplug but with the phone awake.

LuizAurio
  • 157
  • 1
  • 7
1

Tried a lot of the solutions without success and then I

  1. Clicked "Revoke USB debugging authorizations
  2. Unchecked "USB debugging"
  3. Checked "USB debugging"
Tony Scialo
  • 5,457
  • 11
  • 35
  • 52
1

this is the only solution that worked for me (besides rebooting)

go to device manager open universal serial bus controllers right click USB Root hub, select disable, and then enable again.

Dan Levin
  • 718
  • 7
  • 16
1

When you attach your android with your PC, you will get couple of options mentioning the way you may connect with the computer. In my case, I am using HTC Wildfire and it displays

  1. Charge only
  2. HTC Sync
  3. Disk Drive
  4. USB Tethering

I was also facing the problem the Question states and I have tested the way David Caunt answered but yet device was showing offline. *

I rechecked the options and found I selected the Disk Drive option. Then I changed the option to Charge only mode and again follow David Caunt's steps. I don't know why, but this time it worked for me.

Foyzul Karim
  • 4,252
  • 5
  • 47
  • 70
1

Yes, similar behavior on the Droid 2 Global. Seems as though you can get the USB recognized if you reboot out of recovery. But, otherwise once you are at console, adb devices shows the device as offline. Not sure how to remedy this problem.

But, as long as you aren't hacking the phone, the I tried it with normal power supply with the battery dropped, and it powered up. So it is getting power. I am not sure if its CyanogenTeam that just forgot to put some sort of indicator.. or what but, don't worry. Your battery is charging.

However, pushing .apks and other stuff is not easy anymore. But hey, when rooting a phone for a friend do you necessarily want them pushing anything.. Anywhere?

John Drefahl
  • 556
  • 3
  • 17
0

fastest way is

Settings -> Developer Options -> Android Debugging

turn off and then on again (tested on CyanogenMod 11)

svarog
  • 9,477
  • 4
  • 61
  • 77
0

Another answer I stumbled across recently: If you have Unity (the game engine) open at the same time, it may lead to unstable or missing devices in Android studio. The only solution I have found is to close Unity while debugging in Android Studio.

Matt Bond
  • 1,402
  • 12
  • 19