MacOS – Airport utility: Scan specific channels

airportmacosterminalwifi

I am using the Airport utility /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport. With the little program I am able to scan my network for WIFI senders. I do however, want to scan only for specific channels (let's say 6 and 11) to speed up the process. This is possible and seems to be common practise on Linux.

The command (linking to the program mentioned above) I use at the moment which takes 5-10 seconds:

sudo airport -s

Sadly, there is no documentation (I found) about this wonderful little helper. The only help is the help page when using flag -h.

Supported arguments:
 -c[<arg>] --channel=[<arg>]    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[<arg>] --scan=[<arg>]       Perform a wireless broadcast scan.
                   Will perform a directed scan if the optional <arg> 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=<arg>  Specify a WPA password
                                  --ssid=<arg>      Specify SSID when creating a PSK
 -h        --help               Show this help 

It seems like the -s parameters takes arg but I can not find any information anywhere in which format I can pass arguments on and which arguments are supported in the first place. Has anyone worked with the tool before? Is there any documentation about this that I missed?

Thanks a lot for any help or pointers.

Best Answer

I don't think the tool does what you wish. It treats scan as "check all channels" and may not even obey restrictions if you set them by hook or crook on which channels are allowed on the interface. It allows you to pre-filter by SSID name as opposed to channel:

airport --scan=whatever

For sniffing, you can use the Wireless Diagnostics application, but it's not command line based/enabled as far as I can tell.

enter image description here

Once you start the program, look in the Window menu for the options available on your OS (the tool is improving over time IMO with more features and capabilities).

You are right and the authors of the airport manual page agree that "airport more information needed here"