Skip to content

Instantly share code, notes, and snippets.

@64lines
Created March 29, 2019 01:05
Show Gist options
  • Save 64lines/eb852d52077534c2787633ee90745da6 to your computer and use it in GitHub Desktop.
Save 64lines/eb852d52077534c2787633ee90745da6 to your computer and use it in GitHub Desktop.
Connect to a WIFI Mac OSX

1. Turn off wifi on your macbook from the Mac OSX terminal command line:

networksetup -setairportpower en0 off

2. Turn on wifi on your macbook from the Mac OSX terminal command line:

networksetup -setairportpower en0 on

3. List available wifi networks from the Mac OSX terminal command line:

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport scan

4. Join a wifi network from the Mac OSX terminal command line:

networksetup -setairportnetwork en0 WIFI_SSID_I_WANT_TO_JOIN WIFI_PASSWORD

5. Find your network interface name:

networksetup -listallhardwareports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment