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)

1
  • 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
    Commented Aug 26, 2015 at 10:53

34 Answers 34

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.

18
  • 7
    On my Samsung Galaxy Mini, a mere restart of the device solves this problem for me.
    – JWL
    Commented Jan 14, 2012 at 9: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
    Commented Aug 6, 2012 at 13:34
  • 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
    Commented Mar 18, 2013 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
    Commented Nov 25, 2013 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 ? Commented Dec 29, 2013 at 1:01
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.)

7
  • The USB cable provided with my Galaxy S device did not work. One I got off eBay did.
    – Jay Tomten
    Commented Apr 10, 2012 at 14:59
  • the cable worked perfectly for mass storage device. but not for debugging. changing the cable solved the issue. =) Commented May 3, 2013 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
    Commented Nov 17, 2013 at 9:50
  • wow , I couldn't figure that out in a million years all by myself!! thank you Commented Dec 26, 2013 at 20:18
  • 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. Commented Aug 1, 2014 at 14:43
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

4
  • 1
    Worked for me- much more succint than the top voted answer. Thanks
    – IcedDante
    Commented Mar 29, 2014 at 16:18
  • 1
    how do I do this in Android Studio? Commented Jan 24, 2015 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
    Commented Jul 24, 2015 at 9: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
    Commented Jul 4, 2017 at 15:54
12

Faced same problem in Windows with Nexus 7 device.

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

7

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

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.

2
  • Restarting the Nexus 7 while connected to my PC just results in the screen displaying the charging logo. Commented Apr 22, 2014 at 2:27
  • 4
    I think you forgot to turn it back on (important part of a restart)
    – AlexVPerl
    Commented Jan 11, 2015 at 8:46
5

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

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

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.

2
  • 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
    Commented Jun 21, 2015 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
    Commented Oct 28, 2016 at 13:33
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 :)

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 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.

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.

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.

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

0
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.

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

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.

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?

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.

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.

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.

1
  • Bit of a vague answer, also OP is running Froyo and not Jelly bean.
    – Kev
    Commented Sep 23, 2012 at 14:47
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.

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.

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!

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.

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.

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.