1

Is there a way to turn on the monitor remotely on macOS? I'm trying to write an app that will do this.

I've tried a couple of things but can't seem to find a way of triggering the screen to turn on after it has been turned off for power saving.

I've got a macOS app that advertises itself on the network via Bonjour. I can communicate to it via sockets, even when the computer is sleeping. However, I'm not sure what I can do from this macOS app that would trigger the screen to come on. I've tried sending a WoL packet and I've tried using Caffiene.

The macOS app doesn't need to pass Apple Review so I'm fine with using private APIs if necessary.

Mark Bridges
  • 8,228
  • 4
  • 50
  • 65
  • well if it has a Intel chip you could use Intel Remote Management Module / Management Engine Although not shure you want such root acess to the machine plus it has a bunch of unexplored vulnerabilities – Imeguras Apr 05 '22 at 11:34
  • Can you consider to `ssh` on to the machine and run a command to turn on the screen ? – Philippe Apr 05 '22 at 19:55
  • What ssh command could you run to turn on the screen? – Mark Bridges Apr 07 '22 at 15:54
  • `pmset` might work, it even accepts a relative time. `pmset relative wake 1`? If it works, know that pmset is a CLI-wrapper over the power management API so you could achieve the same result programmatically. – TheNextman Apr 07 '22 at 23:36
  • Are you 'switching off' screen or entering sleep mode? MacOS supports registring for sleep and wake event notifications - https://developer.apple.com/library/archive/qa/qa1340/_index.html . – Amogh Sarpotdar Apr 12 '22 at 06:09

0 Answers0