Repository: flutter
Issue: [ios][xcode 15]: Running `flutter run` or `flutter attach` throws `SocketException: Send failed (OS Error: Address family not supported by protocol family, errno = 47), address = 0.0.0.0, port = 5353".`
Labels: platform-ios,tool,t: xcode,P2,team-ios,triaged-ios

### Steps to reproduce

1) flutter attach to a physical iOS device

### Expected results

Able to attach  to a physical iOS device

### Actual results

When I tried to use Android Studio to compile a Flutter app onto a physical iOS device, I encountered the following error message:
'Oops; flutter has exited unexpectedly: "SocketException: Send failed (OS Error: Address family not supported by protocol family, errno = 47), address = 0.0.0.0, port = 5353".'

The issue does not occur with Android (physical device/emulator) or iOS emulators, only with a physical iOS device. I also tried creating a new project and compiling it onto a physical iOS device, but the same issue occurred.

### Code sample

<details open><summary>Code sample</summary>

```dart
[Paste your code here]
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
Oops; flutter has exited unexpectedly: "SocketException: Send failed (OS Error: Address family not supported by protocol family, errno = 47), address = 0.0.0.0, port =
5353".
[flutter_43.log](https://github.com/flutter/flutter/files/15317408/flutter_43.log)
[flutter_42.log](https://github.com/flutter/flutter/files/15317410/flutter_42.log)

```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.22.0, on macOS 14.1.2 23B92 darwin-arm64, locale en-MY)
    • Flutter version 3.22.0 on channel stable at /Users/chinhaowong/Documents/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (6 days ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/chinhaowong/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/chinhaowong/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] IntelliJ IDEA Community Edition (version 2023.1.3)
    • IntelliJ at /Users/chinhaowong/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/231.9161.38/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.89.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.88.0

[✓] Connected device (6 available)
    • Gidz Wong (mobile)              • 00008030-001E69583A02402E            • ios            • iOS 17.4.1 21E236
    • Gidz Wong 15 (mobile)           • 00008130-001240D101A0001C            • ios            • iOS 17.4.1 21E236
    • iPhone 15 Pro Max (mobile)      • 405FF317-A240-487B-9104-EC1EF69BBAFE • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 14.1.2 23B92 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 14.1.2 23B92 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 124.0.6367.203

[✓] Network resources
    • All expected network resources are available.

• No issues found!

```

</details>