accept incoming network connections in simulator - xcode 13.4.1

Does anyone know how to rid of this message? It is happening every time I build a project using the simulator with the following versions:

  • xCode 13.4.1
  • mac Monterey 12.4.

I didn't see this behavior in Xcode's previous versions.

The issue seems to be because it is adding a new application every time I build the project into the firewall app list. (image below)

Any tips on how to fix this?

Post not yet marked as solved Up vote post of lucianoperez Down vote post of lucianoperez
1.7k views
  • I just added a local http server framework to one of my iOS projects and I'm now seeing this. It makes sense there is a warning prompt to accept or decline, but like you said, this gets shown every time since Xcode builds a new .app - extremely annoying. Following for a solution 🤞

Add a Comment

Replies

Bump. Same here. Looking for a solution. In my case I have a local server in the test framework for UI testing.

I need this urgently. The change completely breaks our validation testing scripts.

Someone opened a TSI about this, which brought this thread to my attention. Sorry I didn’t reply sooner. The original tags for this thread weren’t ones that I monitor.

To start, I want to be clear that this is about the macOS firewall (System Settings > Network > Firewall), not iOS’s Local Network Privacy feature. When you run on the simulator you use macOS’s networking stack, and thus you’re affected by its firewall configuration.

The macOS firewall identifies a program via its designated requirement (DR). This is a code signing construct that allows the system to know that version N+1 of the program is the ‘same code’ as version N. You can learn more about it in TN3127 Inside Code Signing: Requirements.

The problem is that an iOS app running in the simulator doesn’t have a stable DR. Such an app is ad hoc signed [1], and thus its DR changes from build to build.

The easiest way around this is to disable the macOS firewall in System Settings > Network > Firewall. IMO the firewall doesn’t offer a lot of value because modern threats all centre around outgoing connections, not incoming ones (although I recognise that other folks disagree).

If that’s not an option then your next best option to turn around your network connections. Rather than have your (simulated) iOS code listen for connections, having it make an outgoing connection. Such outgoing connections are not blocked by the firewall.

Share and Enjoy

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

[1] In Xcode parlance this is called Signed to Run Locally. Note that ad hoc signing is different from iOS’s Ad Hoc distribution method.

  • Looks like it is possible to work around this by adding a firewall exception for both XCode and the simulator; see the answer I just posted.

Add a Comment

We are seeing the same issues with Ventura 13.6.6, tested with XCode 14.3 and 15.2.

Additionally if we select "Allow" in the firewall dialog, the application freezes (?).

This solution may be helpful: https://tomsoderling.github.io/Disable-iOS-simulator-connections-popup/

The script in the linked post adds a Firewall exceptions for both XCode and the iOS simulator, this seems to be enough to stop the firewall from prompting, even if the iOS app does not have a stable DR. We have tested this and it works fine.

The post also mentions: "For whatever reason, these two firewall exceptions will be reset whenever you restart your Mac, so put this script in a handy place because you’ll need to run it again."