Tech News
← Back to articles

A macOS terminal command that tells you if your USB-C cable is bad

read original related products more articles

now includes macOS Tahoe support Apple slightly altered the system command for Tahoe

You have a drawer full of USB cables. Half are junk that barely charge your phone. The other half transfer data at full speed. But which is which?

Android Studio solved this. Recent versions warn you when you connect a slow cable to your phone:

I wanted this for the command line. So I “built” usbi , a script to check your USB connections.

The script parses macOS’s system_profiler SPUSBHostDataType command, which produces a dense, hard-to-scan raw output:

With a little bit of scripting, the output becomes much cleaner:

When I connect my Pixel:

Quick notes on the vibe-coding experience

The first version was a bash script I cobbled together with AI. It worked, but was a mess to maintain. Because I let AI take the wheel, even minor tweaks like changing output colors were difficult.

Second time around, I decided to vibe-code again but asked AI to rewrite the entire thing in Go. I chose Go because I felt I could structure the code more legibly and tweaks would be easier to follow. Go also has the unique ability to compile a cross-platform binary, which I can run on any machine.

... continue reading