I recently discovered a way to bypass Apple's Screen Time restrictions on macOS and it's surprisingly simple. Here's how I stumbled upon it and what I learned.
Discovery
How did I discover this? Well, I was testing something and had Apple's Screen Time on with downtime enabled. This causes all the apps to be restricted from opening.
But one thing caught my attention: Raycast still worked. This is not just a one-off thing either, even the settings window for Raycast opened without any issues.
Investigation
Then, I started looking into it. For those who aren't familiar with Raycast, it is a spotlight replacement that allows you to search for anything on your Mac. It does not show on the Dock, which led me to investigate: does hiding your app from the dock trick Apple into allowing it to open? Well, it's not that simple. I tried app.dock.hide() API from Electron, but it didn't work.
Then I remembered: there is another macOS API that allows you to hide your app from the Dock. Perhaps that's it? However, I could not remember the name of the API, so I used ChatGPT to help me find it. Instead of just finding the API, it also found something else...
The Solution
LSUIElement. This is an Info.plist property. For those who don't know what that is, it is a file in every app that contains information and configuration about the app. This property indicates to Apple whether the app runs in the background and doesn’t appear in the Dock. When this property is set to true, it no longer shows in the Dock, and Apple still allows it to open with Screen Time limits enforced.
What about the API that I asked ChatGPT for? Well, it still had a use. The API is NSApp.setActivationPolicy(), which allows you to set if your app is visible in the dock or not. By running NSApp.setActivationPolicy(.regular) in my app's code, I was able to successfully bypass Screen Time while still letting it show in the Dock.
Conclusion
This is a pretty significant oversight in Apple's Screen Time implementation. It seems like Apple only enforces restrictions on apps that register themselves as regular Dock applications from the start. By setting LSUIElement to true in your Info.plist and then dynamically switching to a regular activation policy at runtime, you can slip right past the restrictions.
Should you use this to bypass your own Screen Time limits? Probably not, they are set for a reason. But it's a good reminder that parental controls and self-imposed restrictions on macOS aren't foolproof.
Thanks for reading!
- Evan
