diff --git a/README.md b/README.md index b8a363f..994484d 100644 --- a/README.md +++ b/README.md @@ -960,3 +960,140 @@ Usage: systemsetup -help Usage: systemsetup -printCommands Display commands. ``` + +## airport + +The Airport command-line utility can yield a lot of useful Wi-Fi info. + +```text +$ /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport +Usage: airport + + + If an interface is not specified, airport will use the first AirPort interface on the system. + + is one of the following: + No options currently defined. + +Examples: + +Configuring preferences (requires admin privileges) + sudo airport en1 prefs JoinMode=Preferred RememberRecentNetworks=NO RequireAdmin=YES + +Sniffing on channel 1: + airport en1 sniff 1 + + +LEGACY COMMANDS: +Supported arguments: + -c[] --channel=[] Set arbitrary channel on the card + -z --disassociate Disassociate from any network + -I --getinfo Print current wireless status, e.g. signal info, BSSID, port type etc. + -s[] --scan=[] Perform a wireless broadcast scan. + Will perform a directed scan if the optional is provided + -x --xml Print info as XML + -P --psk Create PSK from specified pass phrase and SSID. + The following additional arguments must be specified with this command: + --password= Specify a WPA password + --ssid= Specify SSID when creating a PSK + -h --help Show this help + +``` + +Probably my favorite use of this command is getting the current network: + +```text +$ /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I + agrCtlRSSI: -40 + agrExtRSSI: 0 + agrCtlNoise: -91 + agrExtNoise: 0 + state: running + op mode: station + lastTxRate: 351 + maxRate: 1300 +lastAssocStatus: 0 + 802.11 auth: open + link auth: wpa2-psk + BSSID: MY_BSSID + SSID: MY_SSID + MCS: 7 + channel: 44,80 +``` + +Also, you can scan your local Wi-Fi networks by running: + +```text +$ /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s +... Networks Here ... +```