[Xoom Android Development] Jewremy:
So...I've seen a whole bunch of confusion out there about USB Host Mode: Which cables work, which cables don't. I'm going to clear it all up for you right now.

So you know how USB cables have 4 wires/pins, right?

WRONG.

Micro (and some types of mini) have 5 pins. This is because of the host mode ability. However, most Micro cables have 4 wires. Pin 4 is empty, because it's just not needed in normal Micro USB cables.

Here's the breakdown of the pins:

1. Red - V+

2. White - Data -

3. Green - Data +

4. Something else (I've seen blue, brown, pink, you name it) - ID

5. Black - Ground

To achieve Host Mode capability, ID (Pin 4) needs to be shorted to Ground (5).

Pins 1-3 and 5 will always have the same color, but ID's color varies.

I can't seem to find anybody in the US who sells a decent host mode cable. VZW, yeah, but they over charge for it like everything else.

DIY-ing Your Own Hostmode Cable

Supplies:

MiniUSB Female to MicroUSB Male Adapter - This Motorola one has wires on all 5 pins.

Any old USB Extension Cord - All of them work. No difference on what kind you get.

Soldering Iron

Wire Stripper / Cutter

Solder

Heat-shrink

Directions:

1) Cut and strip the extension cable at the male end for extra length. Keep the female end.

2) Snip the mini-micro adapter at the female end, right in front of the plug, for the most length possible. Extra length helps with both physical strain on the Xoom's end, and it's always nice to have in case you screw something up. Remember, you can't uncut wires. :]

3) Next, match colors. Red to red, white to white, green to green, black to black.

3a) Twist each pair together, then add the odd colored wire (Pin 4) to the black pair.

3b) Solder each set together, shield it so as not to cause shorts (Heatshrink is ideal around each wire, but hard to do. Duct tape around each of the 4 small wires, then a large piece of heatshrink around the whole thing works as well.

4) You end up with a male MicroUSB-B to female USB-A cable that is host-capable. Test it by plugging your phone into Xoom! - Host cable into the Xoom, Normal micro cable into the female end of the host cable, other end of that into your phone.

You can ADB if you pull up a terminal. All ADB commands work. It's native to the Xoom. I'm guessing that it was meant to be used with ADB over wifi, or host mode was planned to be a built-in feature from the start.

Mounting Drives

Anybody who's had a past android device and has hacked it most likely saw the /dev/block path at some point.

Every device that I've had - Droid 1, Droid 2, Droid Incredible, Nook Color, Droid Eris - has device names in /dev/block. For example, the Droid 2's /system partition is at /dev/block/mmcblk1p21, and the Xoom's is at /dev/block/mmcblk1p8. To better illustrate, take the command to mount the /system partition as r/w.

mount -o rw,remount -t ext4 /dev/block/mmcblk1p8 /system

So...

Plug in your drive to the host cable, host cable into your Xoom. If your drive has a light, it should start flashing. If it's a portable Harddrive (think one of those WD or Seagate 500GB ones), it should start spinning up. I've found that the bigger the drive, the longer it takes the Xoom to see it.

Open a terminal, run the following command:

cd /dev/block
ls

You should see sda and sda1 or sdb and sdb1.

This is your drive.

>>For reference, mmcblk0 is your physical sdcard and mmcblk1 is your internal memory.

>>Also for reference, the Xoom outputs about 5V at 600mA from its USB port. Enough to give your phone some charge if it dies.

Anyway...to mount your usb host drive, run:

busybox mount /dev/block/sda1 /mnt/usbOTG

sda1 could be sdb1 or sdc1 - it looks like the Xoom keeps a record of what's attached, and increments the letter of the drive each time.

To unmount the usb host drive, it's

umount /mnt/usbOTG

And that's USB Host Mode in a nutshell. Get it? Shell? :p

Lemme know if you need clarification on anything.

Updates!

Thanks to Dinomight at his thread, we now have a tool that does most of this for us. Make sure you're running at least Tiamat 1.4.4.

ADB doesn't seem to work over USB with HTC phones. Motorola and LG should be fine, though. I tested with an Incredible and Thunderbolt.