Trigger "mount as disk drive" (aka "USB Mass Storage" mode) from PC I've got an HTC Incredible that I sync to my Linux box.  I'd like the Linux box to automatically detect that the phone is attached (I can do that via adb wait-for-device), and then automatically put the device in "disk drive mode" (I've no idea how to do this part), and then mount the phone as storage, and run my sync script (I've got this covered), and then unmount the phone and return it to "charge only" mode.

I can manually put the device in "disk drive mode" by pulling down the shade and changing the "USB connection type", but I'm not sure how to trigger this remotely from the PC.  Ideally, some adb command would be great, but I'm open to installing an app, or other hacks (the Linux box can usually reach the phone via WiFi ...)

"Disk drive mode" is also known as "USB Mass Storage" (UMS) mode.

In newer (ICS and later), UMS support is being deprecated for MTP (slightly different USB-based transfer protocol).
This app is designed to mount your phone as soon as it is plugged in. It seems to do your missing step.

Alternatively, this command (found from this forum) can be run on the phone (ex. adb shell) to turn on disk mode.

echo /dev/block/mmcblk0 &gt; /sys/devices/platform/usb_mass_storage/lun0/file 
Edit: This only appears to work in recovery.


Auto Mount App