Multipeer Connectivity stopped working between iPad simulators

We have an iPad application that utilizes Multipeer Connectivity to enable local communication between devices running a copy of our app. Until recently, we were able to test this functionality in the Xcode simulator without any issues. We could easily set up multiple simulators and have them all communicate with each other. However, recently, either due to an upgrade to Xcode or MacOS, this functionality ceased working in the simulator. Surprisingly, it still functions perfectly on physical devices.

If we reboot the development computer and launch the simulator immediately after the reboot (without building and sending from Xcode, but running the existing code on the device), the issue resolves. However, the moment we generate a new build and send it to the simulator from Xcode, the multipeer functionality stops working again in the simulator. The simulators won’t reconnect until a reboot of the physical Mac hardware hosting the simulator.

We’ve tried the usual troubleshooting steps, such as downgrading Xcode, deleting simulators and recreating them, cleaning the build folder, and deleting derived data, but unfortunately, none of these solutions have worked. The next step is to attempt to use a previous version of MacOS (15.3) and see if that helps, but I’d prefer to avoid this if possible.

Does anyone have any obvious suggestions or troubleshooting steps that might help us identify the cause of this issue?

Answered by DTS Engineer in 844203022

Much as I’m not a fan of Multipeer Connectivity, I don’t think this is its fault. Rather, it relies on Bonjour and there’s a local network privacy issue that affects all local DNS in the simulator. See this thread.

ps I recommend that you plan to move off Multipeer Connectivity at some point. See Moving from Multipeer Connectivity to Network Framework for specific advice on that front.

Share and Enjoy

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

Much as I’m not a fan of Multipeer Connectivity, I don’t think this is its fault. Rather, it relies on Bonjour and there’s a local network privacy issue that affects all local DNS in the simulator. See this thread.

ps I recommend that you plan to move off Multipeer Connectivity at some point. See Moving from Multipeer Connectivity to Network Framework for specific advice on that front.

Share and Enjoy

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

Multipeer Connectivity stopped working between iPad simulators
 
 
Q