Test wireless signal strength from the command line
If you’re trying to tweak a wireless router to get the best signal, being able to continuously measure the signal strength while you toy with the antennas, placement, and whatever else is really valuable. Here’s a way you can do this through the command line using the airport wireless tool we’ve discussed in the past:
To see a running tally of signal strength use the following command:
while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlRSSI; sleep 0.5; done
You’ll see something like ‘agrCtlRSSI: -38′ with the last number changing frequently, but printed repeatedly on your terminal screen. You can stop this command from refreshing by hitting Control+C.
To report just a single line with signal strength, use the following:
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. I found both of above code samples on MacOSXHints and they’ve been a big help when trying to position my hardware for maximum reception quality.

If you use this one often, you might want to symlink it as follows…
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/bin/airport
…so that “airport” is now symlinked into a directory within your $path, so subsequently instead of having to type out the full path, you can simply type e.g. “airport -I”
Does anyone know how you can get the signal strength of an iPhone connected to a WiFi network? If I open Airport Utility and look under: /Advanced/Logs and Statistics/Wireless Clients/ it shows me signal strength of clients connected to network, any way to get at this from command line? Thanks. :]
There’s another handy way to use this script:
while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlRSSI | sed -e ‘s/^.*://g’ | say ; sleep 1; done
This will let my macbook read the signal strength out loud, while I’m tweaking the antenna in the other room
Thanks!
Instead of:
while x=1; do …
should do:
while true; do …
Avoids confusing the issue with an unnecessary variable.