Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

NWBrowser with bonjour returning PolicyDenied(-65570)

Hi,

Having an issue on one mac using Xcode 16.3 and simulator 18.4. macSO 15.4

We are checking for bonjour:

authorizationBrowser = NWBrowser(for: .bonjour(type: "_bonjour._tcp", domain: nil), using: parameters)
        
authorizationBrowser?.stateUpdateHandler = { [weak self] newState in
  switch newState {
    ...
  }
}

However at the command line we get the error:

nw_browser_fail_on_dns_error_locked [B1] nw_browser_dns_service_browse_callback failed: PolicyDenied(-65570) 

Any idea why this is happening? or what this error means?

Thanks Antz

Answered by DTS Engineer in 835257022
I’m currently researching this change

OK, we’re treating this as a bug. We have an internal bug on file about this already (r. 148870123), but if you want to file your own bug that’d be grand. You don’t have to go into too much detail; just ask that it be dup’d to the our bug and also explain how it’s affecting your day-to-day development.

Please post your bug number, just for the record.

Curiously, this seems to be limited to DNS. I see this problem with NSBrowser and when I connect to a local DNS name, like guy-smiley.local., but I don’t see it when I connect to local IP address

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

However at the command line we get the error:

What do you mean by “at the command line”?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Sorry, I meant Xcode console.

Hmmm, weird. Historically local network privacy was not enforced on the simulator. However, I ran some tests today and it seems that this changed recently. I’m currently researching this change and I’ll post back when I learn more.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I’m currently researching this change

OK, we’re treating this as a bug. We have an internal bug on file about this already (r. 148870123), but if you want to file your own bug that’d be grand. You don’t have to go into too much detail; just ask that it be dup’d to the our bug and also explain how it’s affecting your day-to-day development.

Please post your bug number, just for the record.

Curiously, this seems to be limited to DNS. I see this problem with NSBrowser and when I connect to a local DNS name, like guy-smiley.local., but I don’t see it when I connect to local IP address

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hi,

It looks like we're also being affected by this issue - we develop an app for interacting with network-connected speakers, and Bonjour/mDNS discovery is required for a large part of the functionality. At the moment it's just a handful of tests that are impacted, but if/when developers update it will remove our ability to use the simulator.

It seems to affect the CI build server I've just updated to macOS 15.4 but not my local machine still on 15.3.2.

Is there any workaround for this, maybe setting a preference from the command line or similar?

Also do you want me to also file a bug that can be linked to the internal one already filed?

I'm seeing the same issue affect my app, Reveal (http://revealapp.com).

Even setting up the appropriate NSBonjourServices and NSLocalNetworkUsageDescription entries in an iOS app's property list doesn't allow us to use DNSServiceRegister(…) — all we get is an error: kDNSServiceErr_PolicyDenied.

If anyone has a workaround, I'd love to hear it!

hope resolved soon .

Is there any workaround for this, maybe setting a preference from the command line or similar?

Not that I can see.

The bug has progressed to the point where we understand why things are failing, and the fix involves code changes, not configuration changes.

Also do you want me to also file a bug that can be linked to the internal one already filed?

There’s no need to do that from our perspective, but filing a dup means that you’ll be notified if/when we start seeding a fix.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Please prioritize this bug and tell me where to follow this fix. The bug is very critical for our work, as we use running multiple simulators with a shared local network and local DNS resolving. Our application in a PROD environment depends on Apple Bonjour.

macOS 15.4.1 (24E263) XCode 16.3 (16E140) Simulator

  1. iPad (10th generation) (iOS 18.4 (22E238))
  2. iPad Pro (11-inch) (3rd generation) (iOS 18.4 (22E238))

Just a quick update. Earlier I wrote:

the fix involves code changes, not configuration changes.

To clarify, those code changes are in macOS, not Xcode or the iOS simulator. So the recent Xcode 16.4 beta seed will not help with this issue. And the bug is still present in the macOS 15.5b4 that we started seeding a few days ago.

Please … tell me where to follow this fix.

It’s likely that someone here will update this thread when we ship a fix for this but, if you want to be guaranteed to hear about it, I recommend that you file your own bug and ask that it be marked as a duplicate of our bug (r. 148870123).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

It seems that it also broke the Multipeer Connectivity browser/advertiser

Yes.

Multipeer Connectivity uses Bonjour internally [1], so it’ll be affected by the same underlying issue )-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Last I checked it was still using NSNetService.

does macOS 15.5 fix this issue? our apps use Multipeer Connectivity which is broken and testing is a nightmare

No. Tested it this morning. I was hoping it was a Sim bug but I guess that was deluded.

I guess we await 15.5.1, any hints when that might happen

I still have these issues running macOS 15.5 :-(

NWBrowser with bonjour returning PolicyDenied(-65570)
 
 
Q