Android Device Vanishing
<p>I have a really serious problem which is preventing me from doing Android development at work, which I have a strong imperative to get fixed as quickly as possible.</p>

<p>So, I plug in my phone to my OS X machine. I go to the terminal and I do this:</p>

<pre><code>rutski@imac:~$ adb devices
List of devices attached 
3331833A243A00EC    device
</code></pre>

<p>Now, that looks good so far. But if I do some work for a few minutes I'll eventually get an error somewhere during "adb install", and when I run "adb devices" again I see that now the device is NO LONGER THERE!</p>

<p>So I unplug the phone, and plug it back in. I run "adb devices" and see the device back again, expect the cycle will repeat, and it will reliably disappear after a few minutes.</p>

<p>But it gets better. DDMS for me is completely unusable. I open up an OS X terminal and run "ddms" from the command line. A window pops open with a device list, and my device is there. However, if I so much as click on my device, it will vanish from the list, and I'll get this in the terminal window:</p>

<pre><code>08:26:05 E/EventLog: device not found
com.android.ddmlib.AdbCommandRejectedException: device not found
    at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736)
    at com.android.ddmlib.AdbHelper.runLogService(AdbHelper.java:469)
    at com.android.ddmlib.AdbHelper.runEventLogService(AdbHelper.java:445)
    at com.android.ddmlib.Device.runEventLogService(Device.java:290)
    at com.android.ddmuilib.log.event.EventLogPanel$8.run(EventLogPanel.java:454)
</code></pre>

<p>Yes, I've made sure that USB debugging is enabled. I've done a start-server kill-server with adb. I've rebooted both the phone and my machine several times. Nothing fixes the problem.</p>

<p>What the heck am I doing wrong here?</p>

<p>EDIT:
I just noticed that after rebooting my machine things are stable until I run an app that crashes via something like calling a method on a null object; that's when the device first vanishes from DDMS, and it is flakey forever after. Still, I'm confused about what to do here. I need to be able to debug crashes, and they will happen.</p>
