Test Wireless Signal Strength from Command Line of Mac OS X
If you’re trying to tweak a wireless router to get the best signal, being able to continuously measure the wi-fi signal strength while you toy with the antennas, placement, and whatever else on the network is really valuable. While most users are best served by using the Mac Wi-Fi Diagnostics app to monitor signal strength and performance, another option is to turn to the command line of OS X, and that’s what we’re going to cover here.
This trick is based entirely from the command line using the somewhat secretive airport wireless tool, and it’s available on all Macs with all versions of OS X. Yes the airport tool is still around and as useful as ever, even though wireless networking is now called Wi-Fi on the Mac.
Open the Terminal app to get started. For best results, you’ll probably want to increase the text size of your terminal font, the Command+ keystroke makes that easy.
How to Monitor Wi-Fi Signal Strength from Command Line on Mac OS X and View RSSI History
To see a running tally of signal strength use the following command, be sure the syntax is entered properly with no linebreaks (wrapping is ok) for this to function as intended:
while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlRSSI; sleep 0.5; done
Hit return and you’ll start to see something like the following scrolling on screen:
This is your signal strength indicator, you’ll notice the last number of ‘agrCtlRSSI: -38′ should be changing frequently as it is printed repeatedly on your terminal screen. That number is the strength of your wi-fi signal coming from the router to your Mac.
You can stop this continuous signal monitoring command from refreshing by hitting Control+C at the Terminal window.
Watching Wi-Fi Signal Strength on a Single Line in OS X Terminal
If you don’t want to see a list of wireless signal strength with history (which makes it easy to tell if your adjustments are making things better or worse), you can also have the command report just a single line with signal strength. This can be helpful for scripting and customizing your shell, and may be preferential to some users in general. To have a single line of text, use the following syntax:
clear; while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlRSSI | sed -e 's/^.*://g' | xargs -I SIGNAL printf "\rRSSI dBm: SIGNAL"; sleep 0.5; done
Again just hit Control+C to stop the command.
It’s worth remembering that wi-fi signal strength is impacted by many factors, including the power of the wireless router antenna, interference from local items and physical barriers like a chimney or microwave, radio signals, and much more. For best results, you’ll want to be sure you have chosen the best wi-fi channel for your network, easily possible with this Mac utility, so that the wi-fi broadcast channel has minimal nearby usage and interference.
I found both of above code samples on a long-gone forum page when searching for a way to do monitor signal strength, this was before the days of the Mac OS X Wireless Diagnostics Tool natively including such functionality, and they’ve been a big help when trying to position my wi-fi hardware for maximum reception quality. This command line approach works in all vaguely modern versions of Mac system software, and it’s still around in the latest releases too.