I was having some trouble with my Mac in office when i try to connect wi-fi. When i click the wi-fi button from upper-right side and click on the network i wanted to connect, it was suppose to work but it wasn’t. It was constantly oscilating between “Wi-Fi: On” and “Wi-Fi: Looking for Networks” status.
I tried to fix it from settings but everything was properly set. Then I re-installed OS X but eventhough it took my whole morning, it didn’t help either. I think when re-installing operating system, keeping your whole files and settings is really good feature of Mac but in this case it worked against my benefit.
After some research, i came across this thread on Apple Support Community : Link
Then i was going to follow these instructions from above link:
Test after taking each of the following steps. Back up all data before making any changes.
1. Make sure the network is on the preferred list by following these instructions.
2. Follow the instructions in this support article under the heading “Symptom: The network connection drops unexpectedly.”
3. Make a note of all your settings for Wi-Fi in the Network preference pane, then delete the connection from the connection list and recreate it with the same settings. You do this by clicking the plus-sign icon below the connection list, and selecting Wi-Fi as the interface in the sheet that opens. Select Join other network from the Network Name menu, then select your network. Enter the password when prompted and save it in the keychain.
4. From the Location menu at the top of the Network preference pane, select Edit Locations. A sheet will drop down. Click the plus-sign button to create a new location. Give it any name you want. In the new location, set up the Wi-Fi service with the same settings you used before. ClickApply and test.
5. Launch the Keychain Access application. Search for and delete all AirPort network password items that refer to the network. Make a note of the password first.
6. In some cases, the problem has been resolved by repairing permissions on the startup volume.
7. Reinstall OS X.
But i didn’t. Because I remembered there is a special platform on StackExchange for Apple products. When i asked about it in there i had much simpler way to do it:
before we go on fixing lets find out it is working at all.
In Terminal type (to turn it on)
networksetup -setairportpower en0 on
Next type (to scan)
Finally type (to connect)
networksetup -setairportnetwork en0 WIFI_SSID_I_WANT_TO_JOIN WIFI_PASSWORD
While holding the alt key click on the wifi icon
In the pop up window select Open Wireless Diagnostics…follow the instructions.