Mirror of https://github.com/hsiangenlinlin/air-accept.git

hsiang cd20ff8965 Add Traditional Chinese README 5 hónapja
Resources 173cdf9b3b Initial AirAccept implementation 5 hónapja
Sources 7f1e4beb91 Add poll interval menu and log rotation 5 hónapja
Tests 7f1e4beb91 Add poll interval menu and log rotation 5 hónapja
.gitignore 173cdf9b3b Initial AirAccept implementation 5 hónapja
Makefile 173cdf9b3b Initial AirAccept implementation 5 hónapja
Package.swift 173cdf9b3b Initial AirAccept implementation 5 hónapja
README.md cd20ff8965 Add Traditional Chinese README 5 hónapja
README.zh-TW.md cd20ff8965 Add Traditional Chinese README 5 hónapja

README.md

AirAccept

Language: English | 繁體中文

AirAccept is a small macOS menu bar app that watches for incoming AirPlay Receiver prompts and automatically presses Accept only when the prompt clearly matches an AirPlay request.

It is intended for a Mac that already has the built-in AirPlay Receiver enabled in System Settings.

Why This Exists

macOS can use a Mac as an AirPlay Receiver, and System Settings lets you choose who can AirPlay to it:

  • Current User
  • Anyone on the Same Network
  • Everyone

In practice, even when AirPlay Receiver is enabled and Allow AirPlay for is set to Anyone on the Same Network or Everyone, macOS can still show an incoming AirPlay prompt that must be manually accepted before playback starts.

AirAccept exists for Macs that are used as always-available AirPlay receivers, media machines, or headless/remote systems where manually clicking Accept every time is inconvenient.

Requirements

  • macOS Sequoia 15 or Tahoe 26
  • Xcode command line tools or Xcode
  • Accessibility permission for AirAccept

AirAccept does not require Screen Recording and does not use AppleScript/System Events automation.

Tested on:

  • macOS Tahoe 26.4.1
  • macOS Sequoia 15.7.7

AirAccept uses macOS Accessibility APIs to inspect Notification Center. It should continue working as long as Apple keeps the AirPlay prompt exposed in a similar Accessibility structure, but it is not guaranteed across every macOS release.

Build

make test
make app

The app bundle is created at:

build/AirAccept.app

To build and launch in one step:

make run

If open appears to do nothing, run the app in the foreground to see launch errors:

make debug-run

When it is running correctly from debug-run, the command stays active until you quit AirAccept or press Ctrl-C.

You can move that app bundle to /Applications after building. Keeping the app in a stable path is recommended because macOS Accessibility permissions are tied to the app identity and path.

First Run

  1. Launch build/AirAccept.app.
  2. Use the menu bar item AirAccept -> Request Accessibility Permission.
  3. In System Settings, allow AirAccept under Privacy & Security -> Accessibility.
  4. Optional: enable AirAccept -> Launch at Login if you want it to start automatically when you sign in.
  5. Quit and reopen AirAccept if macOS does not apply the permission immediately.

To confirm it launched, check the log:

tail -n 20 "$HOME/Library/Logs/AirAccept/airaccept.log"

You should see a line like:

[info] ... AirAccept launched pid=12345

Configuration

AirAccept creates this file on first run:

~/Library/Application Support/AirAccept/config.json

Default config:

{
  "poll_interval_ms": 2500
}

poll_interval_ms controls how often AirAccept checks Notification Center for a matching AirPlay request. You can set it from the menu bar under:

AirAccept -> Poll Interval -> 2/3/4/5 seconds

Logs

AirAccept writes newline-delimited JSON events to:

~/Library/Logs/AirAccept/airaccept.log

Each event includes timestamp, host process, prompt summary, parsed device name, action, and reason. It also writes to Apple unified logging with subsystem com.airaccept.AirAccept. The log file rotates at about 1 MB and keeps one previous file at airaccept.log.1.

Launch at Login

Use the menu bar item:

AirAccept -> Launch at Login

This uses SMAppService.mainApp, the macOS 13+ login item API.

Safety Notes

AirAccept does not click arbitrary system dialogs. A prompt must contain AirPlay-specific request text, such as a device wanting to AirPlay to this Mac, and an accept-like Accessibility action before AirAccept clicks through the Accessibility path.