Failed to register observatory port with mDNS with error

An error is reported when Fletter runs IOS real machine: failed to register observation port with mDNS with error

Errors are reported as follows

[VERBOSE-2:FlutterObservatoryPublisher.mm(101)] Failed to register observatory port with mDNS with error -65555.
[VERBOSE-2:FlutterObservatoryPublisher.mm(103)] On iOS 14+, local network broadcast in apps need to be declared in the app's Info.plist. Debug and profile Flutter apps and modules host VM services on the local network to support debugging features such as hot reload and DevTools. To make your Flutter app or module attachable and debuggable, add a '_dartobservatory._tcp' value to the 'NSBonjourServices' key in your Info.plist for the Debug/Profile configurations.

Solution: (refer to the official link document above)

On iOS 14 and higher, enable the Dart multicast DNS service in the Debug version of your app to add debugging functionalities such as hot-reload and DevTools via flutter attach.

1. Rename the application’s info.plist to info-debug.plist. Make a copy called info-release.plist and add it to the Xcode project
2. In info-debug.plist, add the key nsbonjourservices and set the value to_ dartobservatory._ tcp

(optional) add the key nslocalnetworkusagedescription to the text of the desired custom permissions dialog box. (Note: ‘allow shutter tools on your computer to connect and debug your application. This prompt will not appear on release builds.’)

3. In target’s build settings, modify the info.plist file path path/to/info.plist to path/to/Info – $(configuration). Plist.
4. In target’s – & gt; Build Settings > Build Phases > Copy bundle resources build phase. If info-release.plist is deleted (I have deleted it in the figure below)

reference resources

Read More: