Created
September 13, 2019 20:06
-
-
Save mertsalik/f8283f01b33c7aeef220486200776f01 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import objc | |
objc.loadBundle('CoreWLAN', bundle_path = '/System/Library/Frameworks/CoreWLAN.framework', | |
module_globals = globals()) | |
iface = CWInterface.interface() | |
# Scan all available networks | |
iface.scanForNetworksWithName_includeHidden_error_(None, True, None) | |
# Scan with specific name | |
networks, error = iface.scanForNetworksWithName_error_('FooNetworkName', None) | |
# Select network | |
network = networks.anyObject() | |
# Connect | |
success, error = iface.associateToNetwork_password_error_(network, 'foobar_password', None) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment