Scripts · apps · iPhone

Send a notification from your Mac to your iPhone

A script can do it in one line. An app you cannot script needs a different approach. Here are the working methods for both, with commands you can paste.

Updated · macOS 15.0 or later · 7-day trial

In short

  • From your own script or terminal command, publish to ntfy with curl: one line, free, and the ntfy app shows it on your iPhone.
  • Pushover does the same with authenticated tokens for a small one-time price.
  • From an app you cannot script, forward its normal Mac notification with NotiFerry instead of writing anything per app.
  • Every method needs the Mac awake, and none is suitable for secrets or emergencies.

Two different situations

macOS has no built-in command that makes an iPhone buzz, so every working method sends the message through a notification service. The right one depends on where the alert comes from.

  • Your own script or command. You control the code, so it can call a notification service directly. One line of curl is enough.
  • An app you do not control. A video editor, a backup tool, a download manager, or an AI client only posts a notification on the Mac. There is nowhere to add a command, so the notification itself has to be forwarded.

From a script: ntfy

ntfy is a free, open-source notification service with an iPhone app. Install the app, subscribe to a topic name of your choosing, and publish to it from the Mac:

curl -d "Backup finished" ntfy.sh/your-private-topic

The message appears on the phone a moment later. Headers add a title and a priority:

curl \
  -H "Title: Release build" \
  -H "Priority: high" \
  -d "Tests passed, archive uploaded" \
  ntfy.sh/your-private-topic

By default a topic on the public ntfy.sh server is not protected: anyone who knows its name can read and publish to it. Use a long random name, keep it out of screenshots and shared scripts, and do not send secrets through it.

Notify when a long command ends

Chain the publish onto the command. && runs it only on success; a semicolon runs it regardless, which lets you report the exit status:

# Notify only on success
make release && curl -d "Release build finished" ntfy.sh/your-private-topic

# Notify either way, with the exit status
./long-job.sh; curl -d "long-job exited with status $?" ntfy.sh/your-private-topic

If you do this often, put a small wrapper in ~/.zshrc. It runs whatever you pass it, publishes the result, and preserves the original exit code so scripts that depend on it still work:

notify() {
  "$@"
  local code=$?
  curl -s -d "$1 finished with exit code $code" ntfy.sh/your-private-topic > /dev/null
  return $code
}

# Usage
notify make release

From a script: Pushover

Pushover is a commercial alternative with its own iPhone app. Instead of a shared topic name it uses an application token and a user key, so only you can publish to your devices. At the time of writing it costs $4.99 once per platform after a 30-day trial and allows 10,000 messages a month.

curl -s \
  --form-string "token=YOUR_APP_TOKEN" \
  --form-string "user=YOUR_USER_KEY" \
  --form-string "message=Export finished" \
  https://api.pushover.net/1/messages.json

Choose Pushover if you want authenticated delivery without running your own server, and ntfy if you want something free that can also be self-hosted.

From an app you do not control

None of the above helps when the alert comes from an application. You cannot add curl to an export that finishes in a video editor or to a backup tool's completion alert. What many of those apps do have in common is that they post to macOS Notification Center.

NotiFerry forwards from there. It is a menu-bar app that watches Notification Center for new entries and publishes them to an ntfy topic for you, so the same ntfy app on your iPhone receives alerts from any Mac app that posts a normal notification. There is nothing to script per app, you choose how much of the text is sent, and individual apps can be switched off. The setup guide takes about five minutes.

The two approaches combine well. A script can post an ordinary Mac notification, and the forwarder carries it along with everything else:

osascript -e 'display notification "Export finished" with title "Render queue"'

macOS shows these under Script Editor, which must be allowed to notify in System Settings before the first one appears.

Which to use

MethodBest forEffortCost
ntfy with curlYour own scripts, cron jobs, and terminal commandsOne line per scriptFree
Pushover with curlScripts that need authenticated deliveryCreate an application token, one line per scriptOne-time purchase per platform
NotiFerryApps that only notify on the Mac, and mixed setupsOne setup, then nothing per appOne-time purchase after a trial

If every alert you care about comes from code you wrote, a script is all you need and NotiFerry adds nothing. If some of them come from apps, forwarding covers those without replacing your scripts. For the wider field, including Hermes and Apple's own features, see the comparison of Mac-to-iPhone notification apps.

Questions

Is there a built-in way to send a notification from a Mac to an iPhone?

No. macOS can post a notification on the Mac itself, and Apple can show iPhone notifications on a Mac, but there is no built-in command or setting that delivers a Mac-generated notification to an iPhone. A notification service such as ntfy or Pushover, or a forwarder such as NotiFerry, fills that gap.

What is the simplest command to notify my iPhone from the terminal?

With the ntfy app installed and subscribed to a topic: curl -d "Backup finished" ntfy.sh/your-private-topic. Replace the topic with a long random name that only you know.

Can I get the notification on my iPhone without writing a script?

Yes, if the source posts a macOS notification. NotiFerry forwards new Notification Center entries to your iPhone through the ntfy app, so apps you cannot script are covered by a single setup.

Is an ntfy topic private?

Not by default on the public ntfy.sh server. Anyone who knows the topic name can subscribe or publish, so the name works like a password. Use a long random name, or run your own ntfy server with access control.

Does the Mac need to be awake?

Yes. A script cannot run and a forwarder cannot forward while the Mac sleeps. Keep the Mac awake for as long as the job you want to hear about is running.

Founding release

For the alerts no script can reach.

The trial starts only after you confirm that a real test reached your phone. Keep NotiFerry with a one-time €9.99license for up to 2 Macs. Purchases include a 30-day full-refund window; mandatory consumer rights remain unaffected.

Buy NotiFerry · €9.99Download the free trial insteadOne-time purchase · up to 2 Macs · periodic online license validation