Automatically Connect Mac to personal hotspot if no more preferred network available, based on network change. i.e. turn on/off wifi, connected/disconnected to a network, etc.
As of macOS 12.4, Apple does not allow you to automatically initialize connection to your iPhone's hotspot as it treats the hotspot in a proprietary fashion which differs than treating other Wifi networks. This tool helps you achieve that. This program is intentionally written and will be maintained in the future in pure shell(bash) script so that no dependencies need to be introduced.
When network change like turning on/off Wifi takes place, this tool is triggered and will check for connectivity, available wifis, if trigger ssid is around and so on. If all conditions are met, it will keep trying to connect to your specified hotspot at a specified frequency for a specified duration, until either connected to this hotspot or above trigger condition fails(e.g. already connected to another network).
- Elevated privilege to install the daemon
- Grant Access Control permission to
/usr/bin/security
of the hotspot ssid in Keychain Access - Password for the hotspot has been saved to keychain
- None
- GrantAccess Controlpermission to
/usr/bin/security
of the hotspot ssid inKeychain Access*- Open Keychain Access
- Select All items tab
- Input the SSID of your hotspot in the search box and search
- Select the record with of your SSID name with System in Keychain column and double click
- Choose Access Control tab
- Click + and input the path to security
/usr/bin
(keyboard shortcut:command shift g
) - select security and Add
- clone the repo
- Modify the
ProgramArguments
key in plist file to your need- The first arg is the program itself, DON'T modify
- The second arg is the SSID of your hotspot
- The third arg is the maximum time duration to run this script when network change occurs and not yet connected to hotspot
- The fourth arg is the trigger SSID that if present in available Wifis or unspecified then connect to hotspot, otherwise do nothing.
sudo ./install.sh
sudo ./uninstall.sh
- Add more trigger conditions