Repository: flutter
Issue: [iOS] print function not print the logs to the terminal when run with `flutter run --release` command with physical device
Labels: platform-ios,tool,a: release,has reproducible steps,P2,team-tool,triaged-tool,found in release: 3.24,found in release: 3.25

### Steps to reproduce

Steps:
1. Create an empty project: `flutter create test_log`
2. Add `print` to `_incrementCounter`
```dart
class _MyHomePageState extends State<MyHomePage> {
...

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
      print('test log _counter: $_counter');
    });
  }
...
}
```
3. Run in terminal: `flutter run --release`
4. Click the "+" button
5. No logs with `test log _counter: xx` printed in the terminal
<img width="813" alt="image" src="https://github.com/user-attachments/assets/ffa4c02d-536d-4fd7-ae47-dfd2f1249bf9">


But if I run the APP with the Xcode, change the schema to `Release`
<img width="922" alt="image" src="https://github.com/user-attachments/assets/e411f799-7666-4829-a455-20e8b8d3c455">

The logs can be printed in the Xcode console
<img width="665" alt="image" src="https://github.com/user-attachments/assets/6a48eecc-988a-4f7f-826b-5f2c0e4fdc73">

And there's no issue on Android.




### Expected results

The logs can be printed in the terminal.

### Actual results

The logs can not be printed in the terminal.

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

My device: iPhone 8, iOS 14.8.1

<details open><summary>Doctor output</summary>

```console
➜  test_log_print_ios flutter doctor -v
[✓] Flutter (Channel stable, 3.22.2, on macOS 14.0 23A344 darwin-arm64, locale zh-Hans-CN)
    • Flutter version 3.22.2 on channel stable at /xxx/Library/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 761747bfc5 (3 months ago), 2024-06-05 22:15:13 +0200
    • Engine revision edd8546116
    • Dart version 3.4.3
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /xxx/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /xxx/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • 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.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.85.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.94.0

[✓] Connected device (4 available)
    • ....

[✓] Network resources
    • All expected network resources are available.
```

</details>