OS X allows users set a password for their account on Mac so that no else can log into their computer without their permission. But these days, there is a new trend of locking/unlocking devices remotely.

A new app, Knock, allows you to unlock your Mac by knocking twice on your iPhone. You just need to pair your Mac and your iPhone via bluetooth and install the apps on your Mac and iPhone. The app claims to use Low Energy Bluetooth which consumes less power. And if you ever lost your phone, you can just type in your password in the login screen and unlock your Mac just like you used to do usually.

knock-keyhole

But there are some limitations with the app, one of which is it doesn't works for most of the time. Secondly, knocking your phone everytime isn't a good idea. If you're paying $4 for an app like this, you expect fully functionality.


Proximity App

I searched for alternatives and I found some good solutions. Proximity, is a simple app that allows you to run custom scripts based on the connectivity of your Mac's bluetooth with a particular device.

It is easy to set up Proximity with your iPhone or Android or any of your bluetooth device that you would like to use to lock or unlock your Mac.

How to Setup Proximity

What we will be doing is paring the Mac with your phone and then we will be using Proximity to run scripts for locking and unlocking your Mac based on the Bluetooth connectivity.

First, you need to go to System Preferences > Bluetooth to pair your phone or bluetooth device with your Mac. Once done, download the Proximity app from the link mentioned above and install it.

Now, open AppleScript editor from Applications > Utilities folder and create a new script with the following contents and save it as LockMac. tell application "System Events" set ss to screen saver "Random" start ss end tell Create one more new script with following contents and save it as UnlockMac. tell application "System Events" set ss to screen saver "Random" start ss end tell

proximity-unlock-options

Open the preferences of the app from the Finder bar icon. Now, click on "Change Device" under Bluetooth device and select the device that you want to use to Lock and Unlock your Mac. Now, select the LockMac script in Out of Range script section and select UnlockMac script in In Range script.

Once done, you can test the application by just switching the Bluetooth off on your phone, you will see that your Mac goes on screen saver mode and will need password to unlock.