Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting OSX Connected Wi-Fi Network Name

I need to get the name of the currently connected Wi-Fi SSID on OSX.

I've messed with the SystemConfiguration framework, I feel like it is there (as I am able to get the name of the network locaiton) but I am not really finding a way of getting the Wi-Fi SSID.

Would appreciate any help. :)

Thanks.

like image 318
EduAlm Avatar asked Jan 19 '11 21:01

EduAlm


People also ask

How do you find the Wi-Fi name on a Mac?

Find the Wi-Fi You're Connected to on macOS If you've already connected to a Wi-FI network, you can find its name in the Wi-Fi menu in Mac's menu bar. Find and select the Wi-Fi menu in the Mac's menu bar. The network you are connected to will be listed with a lock icon.

How do I get my IMAC to show all Wi-Fi networks?

Open System Preferences from the  Apple menu and choose “Network” Click the “Advanced” button and choose the “Wi-Fi” tab. Look under the “Preferred Networks” list to find the list of previously connected wireless networks, it is scrollable.

What network is my Mac connected to?

On your Mac, choose Apple menu > System Preferences, then click Network . Select the network connection you want to check in the list at the left.


1 Answers

For osX Yosemite 10.10 use

#import <CoreWLAN/CoreWLAN.h>

-(void)prettyFunctionName
{
  CWInterface* wifi = [[CWWiFiClient sharedWiFiClient] interface];

  NSLog(@"BSD if name: %@", wifi.interfaceName);
  NSLog(@"SSID: %@", wifi.ssid);
  NSLog(@"txRate: %f", wifi.transmitRate);
}
like image 189
Igniz Avatar answered Sep 19 '22 16:09

Igniz