SkillPilotAI

macOS Wi-Fi: wdutil, networkQuality, system_profiler, systemsetup, security

Five built-in macOS command-line tools for Wi-Fi and network troubleshooting: wdutil for the Wi-Fi link, networkQuality for internet capacity and responsiveness, system_profiler for reports, systemsetup for time/NTP/SSH settings and security for saved Wi-Fi passwords. They are macOS-only, so the video shows syntax and Apple's documented output, plus a Linux iperf3 lab for the same idea.

182.1 Why is it used?

  • wdutil: Wireless Diagnostics from the command line (RSSI, noise, channel, logs, diagnose bundle for support).
  • networkQuality (macOS 12+): uplink/downlink capacity and Responsiveness (RPM), i.e. latency under load.
  • system_profiler: hardware and network report (Wi-Fi card, current network) as text, XML or JSON.
  • systemsetup: date, time zone, NTP, Wake on LAN, remote login (SSH), computer name.
  • security find-generic-password: read a saved Wi-Fi password from the keychain (with permission).
  • Many of these commands need sudo.

182.2 How it works: link vs whole path

  • wdutil info only checks the Wi-Fi link between the Mac and the router: signal strength and noise.
  • networkQuality loads the whole internet path: it uploads and downloads a lot of data to Apple's test servers (it consumes data).
  • During that load it sends small requests and measures how quickly replies come back.
  • Under upload the router buffer fills, small packets wait in the queue: this is bufferbloat, the lag you feel in a video call.
  • Result is reported as RPM (round trips per minute): higher RPM = more responsive; Apple labels it Low, Medium or High.
Bufferbloat: why responsiveness matters
  1. 1.MacBook (en0, Wi-Fi) -> Wi-Fi router (ch 149, 5 GHz) -> Apple test servers

  2. 2.networkQuality starts a bulk upload

  3. 3.Router buffer fills up: packets queue

  4. 4.A small request has to wait in that queue

  5. 5.Reply comes back late: latency under load goes up

  6. 6.networkQuality reports it as RPM (Low / Medium / High)

wdutil sees only the Wi-Fi hop; networkQuality sees the whole path under load

182.3 wdutil (Wireless Diagnostics)

CommandWhat it does
sudo wdutil diagnoseRun all Wireless Diagnostics tests without the UI (report in /var/tmp)
diagnose -f <dir>Save the report into your own folder
sudo wdutil infoCurrent Wi-Fi details
log +dhcp +odDHCP and OpenDirectory logging on
log +dns / log +wifiDNS / Wi-Fi logging on
log -eapolEAPOL logging off
sudo wdutil dumpWrite the log buffer to /tmp/wifi-*.log
Terminal
sudo wdutil info
Output
$ sudo wdutil infoSSID : HomeWiFiRSSI : -55 dBmNoise : -92 dBmChannel : 149 (5GHz, 80MHz)Tx Rate : 866.0 Mbps
  • Documented example from the course PDF (no Mac in the lab).
  • SNR = signal - noise = -55 - (-92) = 37 dB.
  • Good link: RSSI above -67 dBm and SNR above 25 dB.
  • Newer macOS versions may show the SSID as redacted.

182.4 networkQuality

OptionMeaning
(none)Upload + download in parallel, plus RPM
-vVerbose detail
-sUpload and download separately (sequential)
-d / -uSkip download / skip upload (with -s)
-I en0Test only on this interface
-M 20Max run time in seconds
-c / -c result.jsonJSON to stdout / into a file
-pVia iCloud Private Relay
-f h1|h2|h3, -f L4S, -f noL4SForce HTTP version, L4S on/off (combine: -f h2,noL4S)
-r 17.253.0.1Skip DNS, connect to this IP
-C <url|file://>Custom server config
-S 4433 / -kStart a local test server (self-signed) / client skips TLS verify
-b / -B "Office NQ"List Bonjour servers / test this Bonjour server
Terminal
networkQualitynetworkQuality -s -vnetworkQuality -I en0 -c \  | python3 -m json.tool
Output
$ networkQuality==== SUMMARY ====Uplink capacity: 38.512 MbpsDownlink capacity: 245.115 MbpsResponsiveness: High (1650 RPM)Idle Latency: 18.250 milliseconds

182.5 Linux equivalent lab: capacity and latency under load

  • Not networkQuality: the same idea on Linux with iperf3 in a Docker lab (client 192.168.202.20, server 192.168.202.10).
  • -R reverses the direction (server sends), i.e. download.
Terminal
iperf3 -c 192.168.202.10 -t 5 | tail -4iperf3 -c 192.168.202.10 -t 5 -R | tail -4
Output
$ iperf3 -c 192.168.202.10 -t 5 | tail -4[  5]   0.00-5.00   sec  2.60 GBytes  4.47 Gbits/sec                  receiver$ iperf3 -c 192.168.202.10 -t 5 -R | tail -4[  5]   0.00-5.01   sec  2.21 GBytes  3.79 Gbits/sec  2693             sender[  5]   0.00-5.00   sec  2.20 GBytes  3.79 Gbits/sec                  receiver
Terminal
ping -c 10 -i 0.2 192.168.202.10 | tail -2iperf3 -c 192.168.202.10 -t 8 -P 4 \  > /tmp/load.txt & sleep 1ping -c 20 -i 0.2 192.168.202.10 | tail -2ping -c 10 -i 0.2 192.168.202.10 \  | awk -F/ '/^rtt/ {print $5, 60000/$5}'
Output
$ ping -c 10 -i 0.2 192.168.202.10 | awk -F/ '/^rtt/ {print $5, 60000/$5}'0.113 530973
  • Idle ping average was about 0.15 ms.
  • With 4 parallel iperf3 streams filling the link, the average rose to about 1.5 ms (max 24 ms): about 10x more delay under load.
  • RPM = 60000 / average ms; on the idle link that is about 5 lakh round trips per minute.

182.6 system_profiler

Terminal
system_profiler                          # full text reportsystem_profiler -listDataTypes           # all data typessystem_profiler SPAirPortDataType        # only the Wi-Fi reportsystem_profiler SPSoftwareDataType SPNetworkDataTypesystem_profiler -xml > network.spx       # XML for System Informationsystem_profiler -json SPAirPortDataType  # JSON for scriptssystem_profiler -detailLevel mini        # no personal info (basic, full)system_profiler -timeout 30 2>/dev/null  # max wait (default 180), hide progress

182.7 systemsetup

AreaGetSet
Date / time-getdate, -gettime-setdate 04:15:26, -settime 16:20:00
Time zone-gettimezone, -listtimezones-settimezone Asia/Kolkata
NTP-getusingnetworktime, -getnetworktimeserver-setusingnetworktime on, -setnetworktimeserver time.apple.com
Wake on LAN-getwakeonnetworkaccess-setwakeonnetworkaccess on
Modem wake-getwakeonmodem-setwakeonmodem off
SSH-getremotelogin-setremotelogin on, -setremotelogin -f off
Apple events-getremoteappleevents-setremoteappleevents on
Names-getcomputername, -getlocalsubnetname-setcomputername "Office-Mac", -setlocalsubnetname office-mac
Help-version-help, -printCommands
  • Most systemsetup commands need sudo; remote login also needs Full Disk Access.
  • -setremotelogin -f off turns SSH off without confirmation: it can cut your own remote session.

182.8 security find-generic-password

  • macOS saves a Wi-Fi password as a generic password: service AirPort, account = your SSID.
  • -w prints only the password; -g also shows the attributes.
  • -a (account), -s (service), -D (kind), -l (label), -j (comment), -c/-C (creator/type codes), -G (generic attribute) narrow the search.
  • A keychain path at the end (e.g. /Library/Keychains/System.keychain) limits the search to that keychain.
Terminal
security find-generic-password \  -D "AirPort network password" \  -a "MyWiFi" -w # Keychain dialog (Apple Support):#   Deny          no password given#   Allow Once    this time only#   Always Allow  always, no asking# Keychain Access: "Show password"#   asks for keychain password

182.9 Common mistakes

  • Treating networkQuality as just a speed test: the key number is Responsiveness; two links with the same Mbps can give very different call quality.
  • Blaming Wi-Fi signal for a freezing call when capacity is high and responsiveness is Low: that is bufferbloat.
  • Running systemsetup -setremotelogin -f off over SSH and locking yourself out.
  • Reading passwords on a Mac or network that is not yours.

182.10 Interview tips

  • Mac Wi-Fi diagnosis: sudo wdutil info (RSSI, noise, channel) -> networkQuality (capacity + RPM) -> system_profiler report -> share the wdutil diagnose bundle.
  • SNR = RSSI - noise; good link is RSSI > -67 dBm and SNR > 25 dB.
  • RPM = round trips per minute under load; low RPM with high Mbps = bufferbloat.
  • Wi-Fi passwords live in the keychain as generic passwords (service AirPort, account SSID).