Skip to content
simlinedevPublic

About

Simline for Mac: send and receive your iPhone's texts through Messages on your Mac

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Simline for Mac

Use your iPhone with Simline. Simline for Mac runs on a Mac that's linked to your iPhone: texts you send from the Simline API, dashboard or AI agents go out through the Messages app on your Mac, from your iPhone's number, and texts your iPhone receives show up in Simline. It works on its own while your Mac is awake and signed in to Messages.

What you need

  • An iPhone, and a Mac with macOS 11 or later, both signed in to Messages with the same Apple Account.
  • Text Message Forwarding turned on for your Mac. On your iPhone: Settings → Apps → Messages → Text Message Forwarding (iOS 17 and earlier: Settings → Messages → Text Message Forwarding), then turn on your Mac. Without it your Mac can only send iMessages.
  • Node.js 22.13 or later on your Mac (nodejs.org, or brew install node).

Set up

  1. In the Simline dashboard open Devices → Pair device → iPhone (with a Mac) and copy the command shown there (it has your code in it).

  2. On your Mac, in Terminal:

    npx @simline/mac@latest pair KQ74XM   # your code
    npx @simline/mac@latest doctor        # checks everything below, says how to fix what's missing
    npx @simline/mac@latest install       # start at login, restart if it stops

    npx (part of Node.js) downloads Simline for Mac from npm (@simline/mac) and runs it; there's nothing else to install. @latest is always the newest version.

  3. Grant the permissions doctor asks for (once):

    • Full Disk Access — System Settings → Privacy & Security → Full Disk Access. Add your terminal app (Terminal, iTerm…) and, for the background service, Node.js (install prints its path; in the file picker press ⌘⇧G and paste it).
    • Automation → Messages — macOS asks the first time Simline for Mac sends a text or runs doctor; click OK. You can change it later in System Settings → Privacy & Security → Automation.

Texts go out and come in while your Mac is awake. To keep it going around the clock, let it stay awake on power: System Settings → Battery (or Energy Saver) → Options → prevent automatic sleeping when the display is off.

Commands

simline-mac <command> below is short for npx @simline/mac@latest <command>.

Command What it does
simline-mac pair <CODE> Pairs this Mac with your workspace. The device token goes into your login Keychain (or, if that isn't possible, a file only you can read).
simline-mac run Runs in this window. Ctrl-C to stop.
simline-mac install / uninstall Starts Simline for Mac at login and restarts it if it stops (a LaunchAgent, ~/Library/LaunchAgents/dev.simline.mac.plist). install copies the app to ~/Library/Application Support/Simline/app/simline-mac.mjs (npx's download folder is temporary) and runs it with the Node.js that ran install; installing again replaces it. Logs: ~/Library/Logs/Simline/.
simline-mac status Pairing, connection, queue.
simline-mac doctor Checks macOS, Node.js, pairing, Full Disk Access, Automation, Messages sign-in, Text Message Forwarding, the connection to Simline, and the login item.
simline-mac unpair Removes the pairing, token and queue from this Mac. Also remove the Mac under Devices in the dashboard.

--api <url> (or SIMLINE_API) points at another Simline server, e.g. a local one.

Updates

Update to a new version (and restart the background service) by installing it by its version number, e.g.:

npx @simline/mac@0.2.0 install

Naming the version makes the command exact: npx can keep using a copy it already downloaded. The dashboard, the server's version policy and run all print the command with the right version. npm view @simline/mac version says what the newest version is.

run checks the server's version policy at startup (GET /v1/app/version) and logs when a newer version is available. If the server no longer supports this version (at startup, or when it answers with updateRequired / close 4003 / HTTP 426), run prints the command above and exits with code 3 instead of reconnecting. Under the LaunchAgent (KeepAlive restarts a non-zero exit, ThrottleInterval 10 s) it waits an hour before exiting, so an outdated copy checks in about once an hour rather than every 10 seconds; install of the new version replaces it immediately.

How it works

  • Sending. Simline sends each text to your Mac over the same live connection Android phones use. Your Mac saves it, confirms it, and asks Messages to send it (one at a time, within your workspace's rate limit). sms goes out as a text message through your iPhone; imessage as an iMessage; sms_or_imessage tries a text message first and iMessage if that fails. Simline for Mac then watches Messages until the text shows as sent, or as failed (with Messages' error code).
  • iMessage only when signed in. Simline for Mac tells Simline it can send iMessages only while Messages on your Mac is signed in to iMessage (checked every few minutes).
  • Sent is final. Messages doesn't report delivery for text messages, so a text from your Mac never shows as delivered; Sent is the last status.
  • Receiving. Every 2 seconds it looks for new texts in Messages and forwards them, until Simline confirms each one.
  • Nothing lost, nothing twice. The queue is saved on your Mac before a text is confirmed, and a text is marked as handed to Messages before Messages sees it. After a crash or restart, a text that may already have gone out is checked in Messages, never sent again.

Privacy

  • Simline for Mac reads the Messages database (~/Library/Messages/chat.db) read-only. That's why it needs Full Disk Access: macOS protects that file, and there is no other way to see incoming texts.
  • It forwards only texts that arrive after you pair your Mac. Your Messages history, attachments and reactions are never uploaded.
  • It keeps no copies beyond its small local queue (~/Library/Application Support/Simline/state.json, readable only by you): message text is removed from it as soon as a text is sent or confirmed.
  • Logs contain message ids and statuses, not message text or phone numbers.
  • The device token is only sent to the Simline server. unpair deletes it from your Mac.

Troubleshooting

Run simline-mac doctor first. It explains each problem with the steps to fix it.

Status error code Meaning
NO_SMS_ACCOUNT Messages has no text message account: turn on Text Message Forwarding (see above).
NO_IMESSAGE_ACCOUNT Messages isn't signed in to iMessage.
AUTOMATION_DENIED Simline for Mac isn't allowed to control Messages (Privacy & Security → Automation).
INVALID_RECIPIENT Messages couldn't find that number or address.
MESSAGES_ERROR_<n> Messages marked the text as not sent; <n> is Messages' own error number.
SEND_TIMEOUT The text didn't show as sent in Messages in time (e.g. your iPhone was off or out of reach).
CHAT_DB_UNAVAILABLE Full Disk Access is missing, so Simline for Mac couldn't check the outcome; the text was not sent.
SIM_DISABLED Sending is turned off for this Mac in the dashboard (Devices).
EXPIRED The text waited too long, e.g. while your Mac was asleep.

Development

Releases go to npm as @simline/mac: bump version in package.json and push to main; the publish workflow tests it, publishes it (with provenance) and tags the release. Then raise the macOS latestVersionCode in the server's version policy so the update command follows it.

The macOS parts sit behind small interfaces with fakes, so everything runs on Linux: MessagesSender (osascript / FakeMessages), ChatDb (read-only node:sqlite on chat.db / a fixture database with the real schema), Keychain (security / a 0600 file), LaunchAgent (launchctl / a fake), SystemInfo.

npm run typecheck
npm run test
npm run build     # dist/simline-mac.mjs: one file, no dependencies

End to end against wrangler dev (see apps/api/README.md), with Messages faked:

export SIMLINE_MAC_FAKE=1 SIMLINE_MAC_HOME=/tmp/simline-mac   # fake Messages + fake chat.db, file token
node dist/simline-mac.mjs pair DEVABC --api http://localhost:8787
node dist/simline-mac.mjs run
# another terminal: send through the API (or POST /v1/dev/send), then a reply:
node dist/simline-mac.mjs fake-inbound +15551234567 "Got it, thanks"   # add --imessage for iMessage

SIMLINE_MAC_FAKE_ERROR=22 makes every fake send fail with that Messages error; SIMLINE_MAC_FAKE_NO_SMS=1 removes the text message account. SIMLINE_MAC_CHAT_DB points at another Messages database.

Protocol: the Simline device protocol ("Device platforms" covers the Mac), schemas from @simline/protocol.

Community

About

Simline for Mac: send and receive your iPhone's texts through Messages on your Mac

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages