MacLock is an ultra-lightweight, native macOS background service (LaunchAgent) that allows you to remotely lock, restart, or shut down your Mac from an Android phone. It operates with zero idle CPU overhead and utilizes both local network discovery and a global cloud relay.
When your Mac and Android phone are on the same local network (e.g., home Wi-Fi, mobile hotspot), the Android app discovers the Mac automatically using Apple's Bonjour (_maclock._tcp). It communicates directly over a secure, self-signed HTTPS connection.
If you are away from your Mac, the Android app can send commands over the internet using a public relay (ntfy.sh).
- Security: Cloud commands are encrypted end-to-end using AES-GCM 256-bit encryption. They also include a 60-second expiration timestamp to prevent replay attacks.
MacLock is built entirely in Swift using Apple's native Network framework. It consumes around ~6.5MB of RAM and 0% CPU while idle. It avoids bloated runtimes like Node.js or Python.
You can install the background daemon either through the provided graphical app or via the terminal.
- Run the
MacLock.appapplication. - Click the Install button to set up the background daemon.
Once installed, MacLock will generate a unique configuration payload containing your credentials.
- Click on "Copy JSON" button on Maclock desktop app.
- Open the MacLock app on your Android device.
- Click on "Paste JSON Config" button which will automatically pasete details in all the fields (name, ip address, port, token, and device id) on the setup screen.
Checking the Logs: To view real-time logs from the background daemon (useful for debugging connections or checking if commands are being received):
log stream --predicate 'subsystem == "com.maclock.service"'Reset MacLock tokens: If you want to reset the tokens, you can do so by clicking on the Reset button in the UI. This will generate a new token and fingerprint, and you will need to update the token in the Android app.
Uninstallation: To completely remove the service, the background daemon, and all associated configurations:
- Open Macklock app and click on Uninstall button which will completely uninstall service and related files from your mac.