Any way to put Mac mini to sleep remotely?

I use a Mac mini as a music centre connected to my stereo system (among other things). I control it remotely using apps such as Remote by Apple, Rowmote, and Remoteless (for Spotify), both on my iPhone and iPad.

Now, when getting to sleep myself, I often want to stop music playback with the device closest to hand, usually iPhone. One more thing I'd like to do remotely is put the Mac mini to sleep. Any idea whether this is possible?

To clarify, I'm looking for an app or other solution that works on iPhone / iPad (with latest iOS, not jailbroken).


Solution 1:

I'm pretty sure you can do this with a hot-corner and the built-in VNC server. (You would need a VNC viewer for iOS, there are LOTS of them.

You could also create an applescript:
tell application "System Events" to sleep
and run it using the VNC connection.


Alternatively, you can turn on ssh, ssh in, and issue the command:
pmset sleepnow (See the pmset man page)
to put the mac to sleep.

This would require a ssh client for iOS. Again, there are a LOT of them. Personally, I have used iSSH, and it works fine.


As @mankoff stated in a comment, RowMote states in it's store description:

  • SLEEP AND WAKE: Put your Mac to sleep by holding the Play button for 3 seconds while controlling any Apple application, just like the hardware remote. Rowmote automatically wakes up sleeping machines which are connected via Ethernet!

Solution 2:

I use the following setup to sleep my Mac by using an iPhone:

  • I created a AppleScript which sleeps the Mac

  • Create a rule in Mail.app, which runs the AppleScript. (I use a specific Subject and from Address to activate the rule)

  • Then on the iOS device, you just need to send a mail, as soon as the Mac receives the mail it will go to sleep

Advantage: You can put your Mac to sleep without the need to be in the same network

Disadvantage: It could take some minutes until the Mac receives the mail.