Remotely unplugging a USB device on my Mac, without touching it

Jeff Geerling Tools

Summary

A developer discovers uhubctl, a CLI tool for per-port USB hub power control, and uses it over a WireGuard VPN to remotely power-cycle a USB-C device plugged into a Mac Studio, avoiding a physical re-plug during firmware debugging.

<p>Tonight I was remote debugging a USB-C device with custom firmware, which was plugged into my Mac Studio at work. I was accessing it over a WireGuard VPN tunnel.</p> <figure class="insert-image"><img src="https://www.jeffgeerling.com/blog/2026/remote-control-usb-hub/m4-max-mac-studio-front.jpeg" alt="Front of M4 Max Mac Studio" width="700" height="auto"> </figure> <p>Part of the debugging process involves flashing firmware to the device using <a href="https://www.sweetwater.com/sweetcare/articles/how-do-i-send-and-receive-sysex-on-pc-or-mac/">MIDI SysEx messages</a>, and while handy, this technique can also be flaky, leaving the device in a partially-flashed state that needs a physical re-plug to recover from.</p>
Original Article
View Cached Full Text

Cached at: 11/27/26, 03:12 PM

# Remotely unplugging a USB device on my Mac, without touching it Source: [https://www.jeffgeerling.com/blog/2026/remote-control-usb-hub/](https://www.jeffgeerling.com/blog/2026/remote-control-usb-hub/) Tonight I was remote debugging a USB\-C device with custom firmware, which was plugged into my Mac Studio at work\. I was accessing it over a WireGuard VPN tunnel\. ![Front of M4 Max Mac Studio](https://www.jeffgeerling.com/blog/2026/remote-control-usb-hub/m4-max-mac-studio-front.jpeg)Part of the debugging process involves flashing firmware to the device using[MIDI SysEx messages](https://www.sweetwater.com/sweetcare/articles/how-do-i-send-and-receive-sysex-on-pc-or-mac/), and while handy, this technique can also be flaky, leaving the device in a partially\-flashed state that needs a physical re\-plug to recover from\. Unfortunately \(well, fortunately, in terms of me taking some time off for Thanksgiving\!\), I am not physically present at the Mac, and the device I was testing*did*need a physical unplug\-and\-replug\. I was going to give up, but instead I wondered if there was a way to power off a USB port on macOS, and then power it back on, which would effectively do what I needed\. A little research with Claude uncovered[`uhubctl`](https://github.com/mvp/uhubctl)which allows 'USB Hub per\-port power control'—exactly what I wanted\. It works with Linux or macOS, and supports a ton of USB Hubs, but only listed explicit Mac support for the "M4 Mac mini \(2 front ports only\)" and "MacBook Air \(Late 2010\)"\. Hoping I'd get lucky, I checked the status on my M4 Max Mac Studio: ``` # Install uhubctl with Homebrew $ brew install uhubctl # List all available ports $ uhubctl Current status for hub 8-3 [05ac:8009 Apple USB2 Hub 7423J07, USB 2.10, 4 ports, ppps] Port 1: 0100 power Port 2: 0100 power Port 3: 0103 power enable connect [3434:0b10 Keychron Keychron Q1 HE] Port 4: 0503 power highspeed enable connect [05e3:0610 GenesysLogic USB2.0 Hub, USB 2.00, 4 ports, ganged] Current status for hub 8-1 [05ac:800a Apple USB3 Gen2 Hub 7423J07, USB 3.20, 4 ports, ppps] Port 1: 0203 power 5gbps U0 enable connect [0bad:c0de Device Under Test] Port 2: 02a0 power 5gbps Rx.Detect Port 3: 02a0 power 5gbps Rx.Detect Port 4: 0203 power 5gbps U0 enable connect [05e3:0617 GenesysLogic USB3.0 Hub, USB 3.00, 4 ports, ganged] ``` I was in luck\! The leftmost front USB\-C port on the Mac Studio looked to be controllable\. I ran the command to power cycle`Port 1`on`hub 8\-1`with a 5 second delay between \(`\-d 5`\): ``` $ sudo uhubctl -l 8-1 -p 1 -a cycle -d 5 Current status for hub 8-3 [05ac:8009 Apple USB2 Hub 7423J07, USB 2.10, 4 ports, ppps] Port 1: 0100 power Sent power off request New status for hub 8-3 [05ac:8009 Apple USB2 Hub 7423J07, USB 2.10, 4 ports, ppps] Port 1: 0000 off Current status for hub 8-1 [05ac:800a Apple USB3 Gen2 Hub 7423J07, USB 3.20, 4 ports, ppps] Port 1: 0203 power 5gbps U0 enable connect [0bad:c0de Device Under Test] Sent power off request New status for hub 8-1 [05ac:800a Apple USB3 Gen2 Hub 7423J07, USB 3.20, 4 ports, ppps] Port 1: 00a0 off Current status for hub 8-3 [05ac:8009 Apple USB2 Hub 7423J07, USB 2.10, 4 ports, ppps] Port 1: 0000 off Sent power on request New status for hub 8-3 [05ac:8009 Apple USB2 Hub 7423J07, USB 2.10, 4 ports, ppps] Port 1: 0100 power Current status for hub 8-1 [05ac:800a Apple USB3 Gen2 Hub 7423J07, USB 3.20, 4 ports, ppps] Port 1: 00a0 off Sent power on request New status for hub 8-1 [05ac:800a Apple USB3 Gen2 Hub 7423J07, USB 3.20, 4 ports, ppps] Port 1: 02a0 power 5gbps Rx.Detect ``` The device was power\-cycled and re\-connected \(along with the corresponding USB 2 port, since both have to be toggled at the same time\), and I could finish the firmware update\. What a handy tool\! It doesn't work with Thunderbolt ports, but all the regular USB\-C and USB\-A ports on my Studio were available\. And apparently it works on most models of Raspberry Pi, though their odd USB configuration means[you can only toggle power to all four ports at once](https://github.com/mvp/uhubctl#raspberry-pi-5)\. Since it wasn't in the support matrix yet, I filed a PR to add the Mac Studio:[Add M4 Max Mac Studio](https://github.com/mvp/uhubctl/pull/691)\.

Similar Articles

Splitting USB-C: USB 3 and USB 2 on One Port

Hacker News Top

A developer shares how the Dongle-Pro v2 splits USB 3 and USB 2 onto a single USB-C port, routing SuperSpeed lanes as passthrough while running a USB 2 hub on the same connector, achieving 10 Gbps recovery dongles that are cheaper and smaller than the USB 2-only version.

You can finally power on a Mac remotely

Jeff Geerling

Apple added a feature in macOS 26.5 that allows Macs introduced from 2024 onward to automatically boot when power is connected, enabling remote power-on without pressing the physical button — useful for remote labs, CI environments, and mobile setups like road cases.

@gdb: sol for debugging laptop power issues:

X AI KOLs Timeline

A user shares how an AI assistant named Sol helped debug a MacBook's random disconnection issue with a CalDigit TS5 dock, identifying that the problem occurred during heavy GPU loads when the dock couldn't supply enough power.

WhatCable: Know what your USB-C cable can do

Hacker News Top

WhatCable is a macOS menu bar app that reads macOS-reported USB-C and Power Delivery data to show cable speed, power capability, display path, and bottlenecks, with an optional Pro tier and a public cable observation database.