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