Repository: flutter
Issue: Running iOS app gets stuck on "Waiting for VM Service port to be available..." when EXECUTABLE_NAME and PRODUCT_NAME don't match
Labels: platform-ios,tool,has reproducible steps,P2,found in release: 3.10,found in release: 3.12,team-ios,triaged-ios

### 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

1. Create custom ios scheme/target configuration - using xcodegen
2. Start ios app by using: ``` flutter run -v -d  iphone --target  lib/main_test1.dart  --flavor  test1 ```


Initially issue reported here: https://github.com/Dart-Code/Dart-Code/issues/4593 but seems like flutter issue nor dart-code


### Expected results

iOS app starts.

### Actual results

App gets stuck at:
```  Waiting for VM Service port to be available... ```
Running app form Xcode works just fine. 

### Code sample

<details><summary>Code sample</summary>

Created project here:
https://github.com/GrzesiekZbozien/tst-flutter

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details><summary>Logs</summary>

```console
[   +3 ms] executing: /usr/bin/arch -arm64e xcrun simctl launch AD01A496-2591-4031-93F3-AE49F9B91E2C com.example.test1 --enable-dart-profiling --enable-checked-mode --verify-entry-points
[ +510 ms] com.example.test1: 14769
[        ] Waiting for VM Service port to be available...
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.4 22F66 darwin-arm64, locale pl-PL)
    • Flutter version 3.10.5 on channel stable at /Users/grzegorz/Documents/flutter-repo/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (7 days ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/grzegorz/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • 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 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] 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)

[✓] VS Code (version 1.79.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.66.0

[✓] Connected device (4 available)
    • iPhone 14 Pro Max (mobile) • 9C50A24D-DFA0-4502-8FAF-82CE18BEB980 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • iPhone 14 Pro (mobile)     • AD01A496-2591-4031-93F3-AE49F9B91E2C • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)            • macos                                • darwin-arm64   • macOS 13.4 22F66 darwin-arm64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 114.0.5735.133

[✓] Network resources
    • All expected network resources are available.

```

</details>