Repository: flutter
Issue: [iOS] Hot restart randomly stops working on real devices after upgrading to Flutter 3.27.1
Labels: e: device-specific,platform-ios,tool,t: hot reload,e: OS-version specific,team-ios

### Steps to reproduce

1. Upgrade to Flutter 3.27.1
2. Connect iPhone 15 Pro
3. `flutter run --verbose`
4. Press R

Happens on all apps.

### Expected results

Hot restart completes.

### Actual results

Hot restart almost never completes between iPhone Pro and MacBook Pro.

Rarely, and unexplainably, it does complete in <1000ms.

Attempted fixes:

* `flutter clean` - **doesn't work**
* Delete and reinstalling Flutter - **doesn't work**
* Upgrading Flutter to latest - **doesn't work**
* Upgrading Dart to latest stable - **doesn't work**
* Upgrading Dart to latest beta - **doesn't work**
* Upgrading iPhone to latest stable - **doesn't work**
* Upgrading macOS latest stable - **doesn't work**
* Different iPhones - **doesn't work**
* Different networks - **doesn't work**
* Different USB-C cables - **doesn't work**
* Different USB-C ports - **doesn't work**
* Factory resetting iPhone - **doesn't work**
* Factory resetting macOS - **doesn't work**
* Downgrade Flutter to 3.24.5 - **DOES work**
* Use iPhone simulator - **DOES work**

Relevant logs:

```
[        ] Performing hot restart...
[  +10 ms] Scanned through 939 files in 8ms
[        ] Syncing files to device Development iPhone...
[   +1 ms] <- reset
[        ] Compiling dart to kernel with 0 updated files
[        ] Processing bundle.
[        ] <- recompile package:app/main.dart 3e53627d-f17f-4999-83a4-c8eda46ebb62
[        ] <- 3e53627d-f17f-4999-83a4-c8eda46ebb62
[   +3 ms] Bundle processing done.
[  +66 ms] Updating files.
[        ] Pending asset builds completed. Writing dirty entries.
[+29475 ms] Error writing "main.dart.swap.dill" to DevFS: HttpException: Request has been aborted
[        ] trying again in a few - 9 more attempts left
[+61249 ms] Error writing "main.dart.swap.dill" to DevFS: HttpException: Request has been aborted
[        ] trying again in a few - 8 more attempts left
[+61263 ms] Error writing "main.dart.swap.dill" to DevFS: HttpException: Request has been aborted
[        ] trying again in a few - 7 more attempts left
[+61268 ms] Error writing "main.dart.swap.dill" to DevFS: HttpException: Request has been aborted
[        ] trying again in a few - 6 more attempts left
[+61244 ms] Error writing "main.dart.swap.dill" to DevFS: HttpException: Request has been aborted
[        ] trying again in a few - 5 more attempts left
[+61263 ms] Error writing "main.dart.swap.dill" to DevFS: HttpException: Request has been aborted
[        ] trying again in a few - 4 more attempts left
[+61247 ms] Error writing "main.dart.swap.dill" to DevFS: HttpException: Request has been aborted
[        ] trying again in a few - 3 more attempts left
[+61253 ms] Error writing "main.dart.swap.dill" to DevFS: HttpException: Request has been aborted
[        ] trying again in a few - 2 more attempts left
[+61246 ms] Error writing "main.dart.swap.dill" to DevFS: HttpException: Request has been aborted
[        ] trying again in a few - 1 more attempts left
[+61255 ms] Error writing "main.dart.swap.dill" to DevFS: HttpException: Request has been aborted
[        ] trying again in a few - 0 more attempts left
[+61262 ms] Error writing "main.dart.swap.dill" to DevFS: HttpException: Request has been aborted
[   +2 ms] Could not update files on device: HttpException: Request has been aborted
[   +3 ms] Syncing files to device Development iPhone... (completed in 673.4s)
[   +2 ms] <- reject
[  +75 ms] Performing hot restart... (completed in 673.5s)
[        ] Restarted application in 673,460ms.
[        ] Try again after fixing the above error(s).
```

### 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
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.27.1, on macOS 15.2 24C101 darwin-arm64, locale en-US)
    • Flutter version 3.27.1 on channel stable at /Users/james/fvm/versions/3.27.1
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 17025dd882 (4 weeks ago), 2024-12-17 03:23:09 +0900
    • Engine revision cb4b5fff73
    • Dart version 3.6.0
    • DevTools version 2.40.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/james/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16C5032a
    • CocoaPods version 1.16.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.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 21.0.3+-79915917-b509.11)

[✓] VS Code (version 1.96.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.102.0

[✓] Connected device (6 available)
    • Development iPhone (mobile)     • 00008130-00184C1C0CA0001C            • ios            • iOS 18.2.1 22C161
    • Virgo (mobile)                  • 00008140-0016219E3693001C            • ios            • iOS 18.2.1 22C161
    • iPhone 16 (mobile)              • 5558CC92-E694-44C3-BDFE-0158DB0BACE4 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-1 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 15.2 24C101 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 15.2 24C101 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 131.0.6778.265
    ! Error: Browsing on the local area network for James’s Apple Watch. Ensure the device is unlocked and discoverable via Bluetooth. (code -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>