Repository: flutter
Issue: Flutter Attach Command Fails on iPhone Over LTE Connection
Labels: c: crash,platform-ios,tool,P2,team-ios,triaged-ios

### Steps to reproduce

Hi,

We’re currently automating tests for a hybrid Flutter-Native app. Since our app includes LTE-specific flows, we need to disconnect the iPhone from Wi-Fi to test LTE flows. However, doing so causes the flutter attach command to stop working.

Has anyone else encountered this issue? Is this expected behavior because flutter attach relies on a local network connection?

Thanks.

1- Connect iPhone to Mac via USB
2- Install application
3- Open application, give necessary permissions
4- Disconnect Wi-Fi
5- Run flutter attach -d <device_uuid> --profile

### Actual results

Can't establish connection. See the logs.

### Logs

<details open>
<summary>Logs</summary>

```console

Flutter crash report.
Please report a bug at https://github.com/flutter/flutter/issues.
 
## command
 
flutter attach -d 00008101-001451391AC3001E --profile
 
## exception
 
String: failed to connect to http://127.0.0.1:50123/7ltDjNOwndE=/

#0      DartDevelopmentServiceImpl.startService (package:dds/src/dds_impl.dart:162:7)
<asynchronous suspension>
#1      DartDevelopmentService.startDartDevelopmentService (package:dds/dds.dart:97:5)
<asynchronous suspension>
#2      DartDevelopmentService.startDartDevelopmentService (package:flutter_tools/src/base/dds.dart:55:22)
<asynchronous suspension>
#3      FlutterDevice.connect.<anonymous closure> (package:flutter_tools/src/resident_runner.dart:298:11)
<asynchronous suspension>
```
</details>


### Flutter Doctor output

```console
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.1 24B5035e darwin-arm64, locale en-US)
    • Flutter version 3.24.3 on channel stable at /opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (3 weeks ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3
 
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/test/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = /Users/test/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/macos-android-setup for more details.
 
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode-beta.app/Contents/Developer
    • Build 16A5221g
    • CocoaPods version 1.15.2
 
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
 
[✓] Android Studio (version 2021.3)
    • 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 11.0.13+0-b1751.21-8125866)
 
[✓] VS Code (version 1.93.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
 
[✓] Connected device (6 available)
    • SM T220 (mobile)                • R9PT713SG4Z               • android-arm64 • Android 12 (API 31)
    • SM X200 (mobile)                • R9YT30J6DSZ               • android-arm64 • Android 11 (API 30)
    • SM A536E (mobile)               • RFCT70KNW8X               • android-arm64 • Android 13 (API 33)
    • iPhone (mobile) • 00008101-001451391AC3001E • ios           • iOS 18.0 22A3354
    • macOS (desktop)                 • macos                     • darwin-arm64  • macOS 15.1 24B5035e darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin        • macOS 15.1 24B5035e darwin-arm64
 
[✓] Network resources
    • All expected network resources are available.
 
! Doctor found issues in 2 categories.
```