macOS – Software-Only Way to Disconnect and Reconnect USB Device

displaymacosusb

I have a DisplayLink 3rd monitor on a Mac Mini. Half the time I wake the computer up, the DisplayLink syncs but the graphics onscreen are garbled. Reaching behind the computer and unplugging/plugging the DisplayLink USB cable fixes it every time.

But this stinks.

Is there a terminal command or AppleScript I could run to make the Mac pretend the USB device was replugged? This would be a much nicer way to bring the DisplayLink back to life.

I found the unmounting USB drives answer which is similar but obviously won't work for a display.

Thanks for any hints.

As for the DisplayLink, it's pretty laggy and I'm stuck on Mountain Lion, but it was cheap and recycles my old monitor. It works just well enough that I'd recommend it to someone with low expectations and wants to use it for mostly static tasks like reading documents and code. Not for editing though — too laggy.

Best Answer

if you felt bold, you could disable all of usb service and then reenable. I believe that will do it. will also kill keyboard etc.

kextunload IOUSBFamily.kext
kextload /System/Library/Extensions/IOUSBFamily.kext

it will take some more discovery, but i think this might be a good path. let us know if you experiment

all usb extensions in 10.8 at least:

/System/Library/Extensions/IOUSBAttachedSCSI.kext
/System/Library/Extensions/IOUSBFamily.kext
/System/Library/Extensions/IOUSBMassStorageClass.kext