Repository: flutter
Issue: ``flutter run`` hangs since Flutter 3.16.0 and Android Studio Giraffe Patch 3
Labels: c: crash,tool,t: flutter doctor,P2,needs repro info,team-tool,triaged-tool

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

I'm not sure exactly what causes this issue, but since I updated to Flutter 3.16.0, and also to Android Studio Giraffe Patch 3, sometimes when I try to start an AVD from VSCode, it just doesn't do anything, and if it starts, when I try to run the debugging version from VSCode it starts the process but it doesn't do anything else, it's stuck on the "Flutter: Launching…" message. To solve it I have to reboot my MacBook.

I also received this error when launching the app:
```console
Error executing devicectl: ProcessException: Process exited abnormally:
ERROR: Command timeout of 5.0 seconds exceeded. Assuming command got stuck and aborting.
  Command: /usr/bin/arch -arm64e xcrun devicectl list devices --timeout 5 --json-output
  /var/folders/s5/t16s9j0547bg7hsgjth4717c0000gn/T/flutter_tools.qGTPqS/core_devices.BrKQsu/core_device_list.json
Error executing devicectl: ProcessException: Process exited abnormally:
ERROR: Command timeout of 5.0 seconds exceeded. Assuming command got stuck and aborting.
  Command: /usr/bin/arch -arm64e xcrun devicectl list devices --timeout 5 --json-output
  /var/folders/s5/t16s9j0547bg7hsgjth4717c0000gn/T/flutter_tools.qGTPqS/core_devices.CFelgh/core_device_list.json
```

### Expected results

With Flutter 3.13.9 and Android Studio Giraffe Patch 1 I never had this issue.

### Actual results

``flutter run`` hangs when trying to run the app. Also, if I run ``flutter doctor -v`` with an Android Virtual Device running, the process also hangs, and after some time this error appears:
```console
Error executing devicectl: ProcessException: Process exited abnormally:
ERROR: Command timeout of 5.0 seconds exceeded. Assuming command got stuck and aborting.
  Command: /usr/bin/arch -arm64e xcrun devicectl list devices --timeout 5 --json-output
  /var/folders/s5/t16s9j0547bg7hsgjth4717c0000gn/T/flutter_tools.E68YiI/core_devices.X8R2QO/core_device_list.json
```

### Code sample

<details><summary>Code sample</summary>

```dart
[Paste your code here]
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details><summary>Logs</summary>
This are the full logs that appear on the debug console of VSCode when I manage to start the app from VSCode. That error wasn't there with Flutter 3.13.9 and Android Studio Giraffe Patch 1.

```console
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
I/flutter ( 5361): dynamic_color: Core palette detected.
D/EGL_emulation( 5361): app_time_stats: avg=19.24ms min=10.14ms max=79.31ms count=55
D/EGL_emulation( 5361): app_time_stats: avg=18.49ms min=2.47ms max=222.33ms count=48
Error executing devicectl: ProcessException: Process exited abnormally:
ERROR: Command timeout of 5.0 seconds exceeded. Assuming command got stuck and aborting.
  Command: /usr/bin/arch -arm64e xcrun devicectl list devices --timeout 5 --json-output /var/folders/s5/t16s9j0547bg7hsgjth4717c0000gn/T/flutter_tools.jjN6IB/core_devices.kh3uaG/core_device_list.json
Error executing devicectl: ProcessException: Process exited abnormally:
ERROR: Command timeout of 5.0 seconds exceeded. Assuming command got stuck and aborting.
  Command: /usr/bin/arch -arm64e xcrun devicectl list devices --timeout 5 --json-output /var/folders/s5/t16s9j0547bg7hsgjth4717c0000gn/T/flutter_tools.jjN6IB/core_devices.S90bW3/core_device_list.json
Error executing devicectl: ProcessException: Process exited abnormally:
ERROR: Command timeout of 5.0 seconds exceeded. Assuming command got stuck and aborting.
  Command: /usr/bin/arch -arm64e xcrun devicectl list devices --timeout 5 --json-output /var/folders/s5/t16s9j0547bg7hsgjth4717c0000gn/T/flutter_tools.jjN6IB/core_devices.B237Ax/core_device_list.json
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.16.0, on macOS 13.6.2 22G320 darwin-arm64, locale es-ES)
    • Flutter version 3.16.0 on channel stable at /Users/juan/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db7ef5bf9f (6 days ago), 2023-11-15 11:25:44 -0800
    • Engine revision 74d16627b9
    • Dart version 3.2.0
    • DevTools version 2.28.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/juan/Library/Android/sdk
    • Platform android-33, build-tools 31.0.0
    • ANDROID_HOME = /Users/juan/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.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A507
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.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 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.84.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.76.0

Error executing devicectl: ProcessException: Process exited abnormally:
ERROR: Command timeout of 5.0 seconds exceeded. Assuming command got stuck and aborting.
  Command: /usr/bin/arch -arm64e xcrun devicectl list devices --timeout 5 --json-output
  /var/folders/s5/t16s9j0547bg7hsgjth4717c0000gn/T/flutter_tools.E68YiI/core_devices.X8R2QO/core_device_list.json
[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 14 (API 34) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 13.6.2 22G320 darwin-arm64
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 119.0.6045.159

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```

</details>