Is there any way to switch quickly from one wifi connection to another wifi connection on Mac?
I need to switch between 2 or 3 wifi connections to run our program.
If you know to make it by command line or shell script or shortcuts, I really appreciate.
On your Mac, choose Apple menu > System Preferences, then click Network . Click the Action pop-up menu , then choose Set Service Order. Drag services into the order you want.
Setting up your Mac or PC to use two or more Wi-Fi connections at the same time is a very simple task. In fact, any computer running Windows 7, 8 or 10 or macOS 10.10+ can connect to any combination of available Internet connections.
The four most common reasons why you may see the “command not found” message in the Mac command line are as follows: the command syntax was entered incorrectly. the command you are attempting to run is not installed. the command was deleted, or, worse, the system directory was deleted or modified.
from @Inian's Help,
see all wifi connections:
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport scan
Join a wifi network from the Mac OSX terminal command line:
networksetup -setairportnetwork en0 WIFI_SSID_I_WANT_TO_JOIN WIFI_PASSWORD
If you know the wifi connections name you can write a script to switch:
case "$1" in wifi1) printf "Switching to wifi1 ...\n" networksetup -setairportnetwork en0 wifi1 password1 ;; wifi2) printf "Switching to wifi2 ...\n" networksetup -setairportnetwork en0 wifi2 password2 ;; *) printf "Unknown wifi" exit -1 esac exit 0
The reference from: http://blog.mattcrampton.com/post/64144666914/managing-wifi-connections-using-the-mac-osx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With