Repository navigation
flutter run does not show logs on iOS #127121
Copy link
Copy link
Closed
Labels
platform-iosiOS applications specificallyiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
void main() {
print("Log from dart");
runApp(const MyApp());
}flutter run -d iphone
Expected results
Should show logs.
Actual results
Doesn't show logs.
Code sample
Code sample
void main() {
print("Log from dart");
runApp(const MyApp());
}Screenshots or Video
No response
Logs
Logs
No logs from terminal:
eseidel@erics-mbp ios_test % flutter run -d iphone
Launching lib/main.dart on iPhone in Pocket in debug mode...
Automatically signing iOS for device deployment using specified development team
in Xcode project: 8R83HS5GZ2
Running Xcode build...
└─Compiling, linking and signing... 1,879ms
Xcode build done. 5.8s
(lldb) 2023-05-18 10:04:50.359884-0700 Runner[1136:55318] [VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(35)] Using the Impeller rendering backend.
flutter: Log from dart
Installing and launching... 11.0s
Syncing files to device iPhone in Pocket... 29ms
Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
A Dart VM Service on iPhone in Pocket is available at:
http://127.0.0.1:55530/RoespouBheY=/
The Flutter DevTools debugger and profiler on iPhone in Pocket is available at:
http://127.0.0.1:9101?uri=http://127.0.0.1:55530/RoespouBheY=/They show up in XCode fine:
2023-05-18 09:51:27.536411-0700 Runner[1037:45700] Metal API Validation Enabled
2023-05-18 09:51:27.708781-0700 Runner[1037:45700] [VERBOSE-2:FlutterDarwinContextMetalImpeller.mm(35)] Using the Impeller rendering backend.
2023-05-18 09:51:27.760726-0700 Runner[1037:46008] flutter: The Dart VM service is listening on http://127.0.0.1:60534/ZpThp0psw04=/
2023-05-18 09:51:27.818336-0700 Runner[1037:45988] flutter: Log from dartFlutter Doctor output
Doctor output
eseidel@erics-mbp ios_test % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.1, on macOS 13.2.1 22D68 darwin-arm64, locale
en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.78.2)
[✓] Connected device (3 available)
! Error: Eric’s Apple Watch has recently restarted. To use Eric’s
Apple Watch with Xcode, unlock it and its companion iPhone (code 19)
[✓] Network resources
• No issues found!eseidel@erics-mbp ios_test % flutter devices
3 connected devices:
iPhone in Pocket (mobile) • 00008120-0011315A2290C01E • ios • iOS
16.4.1 20E252Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
platform-iosiOS applications specificallyiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
eseidel commentedon May 18, 2023
If I add a log to _incrementCounter() those show up:
zanderso commentedon May 18, 2023
cc @vashworth @christopherfujino Guessing that prints near app startup might be getting dropped if the debugger isn't attached yet?
christopherfujino commentedon May 18, 2023
@vashworth do we not start the main isolate paused until the debugger attaches?
vashworth commentedon May 18, 2023
Looks like we do not start it paused (assuming that's what this flag is for).
flutter/packages/flutter_tools/lib/src/commands/run.dart
Line 409 in 2d6c67f
flutter/packages/flutter_tools/lib/src/commands/run.dart
Lines 94 to 97 in 2d6c67f
christopherfujino commentedon May 18, 2023
ahhh
jason-simmons commentedon May 18, 2023
The
flutter: Log from dartlog message is shown in the tool's output (as seen in the logs captured in #127121 (comment))But the log message is printed midway through the
Installing and launchingphase, so it's easy to miss.The flutter_tools iOS device could buffer the debugger log stream until the tool has finished launching the app and printing the tool usage instructions. But that might hide potentially useful logs if something goes wrong during the tool's app launch flow.
christopherfujino commentedon May 18, 2023
wow, eagle eye
eseidel commentedon May 18, 2023
eseidel commentedon May 25, 2023
I think we closed this prematurely? Unless I misunderstood. When I add a log in the engine, from within xcode I get:
flutter build ios --config-only --local-engine-src-path=$HOME/Documents/GitHub/ios_engine/src --local-engine ios_debug_unopt_arm64But from flutter run I get:
This is with:
And then flutter-team-archive/engine@6ff02c1, with a slightly modified dart_lang/sdk of the correct version.
eseidel commentedon May 25, 2023
For clarity, the log I added was:
Maybe I have to turn up the verbosity to see the log?
eseidel commentedon May 25, 2023
Yup, I see the log when I turn on -v. OK.
github-actions commentedon Jun 8, 2023
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.