Skip to content

fix(macos/packaging): add NSLocalNetworkUsageDescription so Bonjour can register#5186

Merged
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
RESMP-DEV:fix/macos/packaging/bonjour-usage-description
May 26, 2026
Merged

fix(macos/packaging): add NSLocalNetworkUsageDescription so Bonjour can register#5186
ReenigneArcher merged 1 commit into
LizardByte:masterfrom
RESMP-DEV:fix/macos/packaging/bonjour-usage-description

Conversation

@Nottlespike
Copy link
Copy Markdown
Contributor

Description

src_assets/macos/build/Info.plist.in declares NSBonjourServices with _nvstream._tcp so the host can advertise itself for Moonlight auto-discovery, but it does not declare NSLocalNetworkUsageDescription. On macOS 14+ this combination causes mDNS service registration to fail with error -65570 (kDNSServiceErr_PolicyDenied):

[Error: Failed to register DNS service: Error -65570]

Apple's Local Network privacy gate treats the missing usage-description key as an implicit opt-out: the OS never prompts the user for permission, and DNSServiceRegister returns PolicyDenied silently. The Bonjour record is never broadcast, so stock Moonlight clients can't auto-discover the server (users have to add the host by IP manually).

Add a usage description so macOS prompts on first launch and allows the DNS-SD registration to succeed once the user grants Local Network access.

After this change, the startup log shows:

[Info: Successfully registered DNS service.]

instead of the -65570 error, and Moonlight on iOS / Apple TV / macOS finds the host automatically over Bonjour.

Screenshot

N/A — Info.plist key addition.

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

Copilot AI review requested due to automatic review settings May 25, 2026 12:00
…an register

Modern macOS denies Bonjour service registration with -65570
(kTCCServiceErr_PolicyDenied) when an app advertises NSBonjourServices
but does not also declare NSLocalNetworkUsageDescription. The OS treats
the missing key as opt-out and never prompts the user, so the Sunshine
mDNS announcement silently fails and Moonlight cannot auto-discover the
host. Adding the usage-description key lets macOS prompt for Local
Network access on first launch and allow DNS-SD registration to succeed.
@ReenigneArcher ReenigneArcher force-pushed the fix/macos/packaging/bonjour-usage-description branch from b5b58d8 to 0eb77b6 Compare May 26, 2026 00:53
@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Bundle Report

Bundle size has no change ✅

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 17.78%. Comparing base (d7e88da) to head (0eb77b6).
⚠️ Report is 2 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5186      +/-   ##
==========================================
- Coverage   17.79%   17.78%   -0.01%     
==========================================
  Files         111      111              
  Lines       24143    24143              
  Branches    10687    10687              
==========================================
- Hits         4296     4294       -2     
+ Misses      15471    14680     -791     
- Partials     4376     5169     +793     
Flag Coverage Δ
Archlinux 11.19% <ø> (ø)
FreeBSD-aarch64 ?
FreeBSD-amd64 13.32% <ø> (ø)
Homebrew-ubuntu-22.04 13.53% <ø> (ø)
Linux-AppImage 12.11% <ø> (ø)
Windows-AMD64 14.85% <ø> (ø)
Windows-ARM64 13.19% <ø> (-0.01%) ⬇️
macOS-arm64 18.86% <ø> (ø)
macOS-x86_64 18.34% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 33 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d7e88da...0eb77b6. Read the comment docs.

@ReenigneArcher ReenigneArcher merged commit 81a8414 into LizardByte:master May 26, 2026
73 of 74 checks passed
@Nottlespike Nottlespike deleted the fix/macos/packaging/bonjour-usage-description branch May 27, 2026 02:33
@ReenigneArcher ReenigneArcher added the ai PR has signs of heavy ai usage (either indicated by user or assumed) label May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai PR has signs of heavy ai usage (either indicated by user or assumed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants