ADB always exits by itself causing (many times) almost wiping my data folder on PC instead of /data on Android.

It does this even while I'm typing commands (!) as if there is a timer that makes it exit after some time.

How to prevent this from happening?

Device details: Galaxy S2 with newest nightly (based on Android 4.4.4); the version is or (If I flash Dorimanx Kernel 10.43v113)

PC details Lubuntu 14.04/14.10 amd64 version with Linux 3.16-rc3

  • It's not clear to me exactly what you're describing. When exactly does it exit? When you're in adb shell? In the middle of an adb push?
    – Dan Hulme
    Commented Jul 6, 2014 at 8:47
  • I'm only using adb shell [Enter Key] then some commands like ls -al /dev/block/platform/dw_mmc/by-name or parted /dev/block/mmcblk0 print or ls /dev/block or just cd cp mv rm -rf dd Commented Jul 6, 2014 at 11:22

1 Answer 1


I don't know if this is the reason for you, but I've seen the symptoms you describe caused by USB problems. There are two particular possible problems:

  1. The cable is loose, probably at the device end. Then wiggling it slightly can cause a brief disconnection. You wouldn't normally notice this, because it only lasts for a second, but it'll terminate an adb shell session, or if you're deploying an app onto the device when it happens, it'll interrupt the transfer.

  2. There's congestion on the USB bus. This can happen when several devices (whether that's several Android devices, or one Android device and something else such as a USB stick or webcam) are connected to the same hub. ADB is not very resilient to bus congestion, so it can disconnect while you're doing a high-bandwidth operation, such as taking a screenshot or running an adb shell command with lots of output.

    Sometimes this can cause a brief disconnection, but sometimes the protocol gets into a bad state, and you can only recover by physically unplugging the device and plugging it back in again.

In either case, you can tell that this is happening because, even if the disconnection is momentary, the device shows the USB debugging notification again as if it had been fully unplugged.

  • I had a few times a message about phone being connected immediately after the exiting BUT it exits even without this too so this is not the only cause. Commented Jul 6, 2014 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .