top | item 44339325

(no title)

tommoor | 8 months ago

Nice, added it as a bash alias.

    alias randommac='sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport en0 -z && sudo ifconfig en0 ether $(openssl rand -hex 6 | sed "s/../&:/g; s/:$//")'

discuss

order

commandersaki|8 months ago

So I tried this out on macOS 26 and the `airport` command is no longer there.

There is a `airportd.sb` file, which appears to be some permissions based thing in s-expression/LISP. Weird.

Edit: Spun up a macOS 15 VM and I got this:

WARNING: The airport command line tool is deprecated and will be removed in a future release. For diagnosing Wi-Fi related issues, use the Wireless Diagnostics app or wdutil command line tool.

I guess they weren't kidding.

bc569a80a344f9c|8 months ago

Looking around briefly, you can replace it with this:

`networksetup -setairportpower en0 on && [... set MAC ...] && networksetup -setairportpower en0 off`

I think it's pretty safe to assume that modern Macs will always have en0 as the WiFi adapter, but if you wanted, you could use `networksetup -listnetworkserviceorder` to find the associated device.