Repository navigation
Logs not printed on iOS devices on build #44718
Description
Activity
- changed the title
[-]Logs not printed on iOS devices on first build[/-][+]Logs not printed on iOS devices on build[/+]on Nov 12, 2019 Exceptions and logs are being printed via the same log reader. I'm going to duplicate this to your other issue #44718.
Exceptions pre-runApp never get printed as far as I can tell.
Logs pre-runApp do get printed on hot restart, but never on first build. May apply to exceptions also, but can't test it due to the above.
My guess is that we're losing logs from the beginning of the first time
main()runs because these get logged before the tool makes the connection to the observatory.Reacted by Jon ScaletA potential solution here is to always start the isolate in a paused state, and then resume after connecting to the vmservice
Reacted by Christopher FujinoA potential solution here is to always start the isolate in a paused state, and then resume after connecting to the vmservice
That's an interesting idea, I like that.
- addeda: debuggingDebugging, breakpoints, expression evaluationDebugging, breakpoints, expression evaluationtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.platform-iosiOS applications specificallyiOS applications specifically
on Nov 13, 2019 @stx I've noticed that the issue seems to occur, not just pre runApp(), but before there's a connection to the observatory, like @christopherfujino mentioned. Have you run into this?
@j0nscalet Correct. This is an issue prior to the connection to the VM service. That's why it only happens on first build and not restart.
Reacted by Jon ScaletSome notes:
I was able to read the observatory port log line withios-deployby attaching to lldb with--debuginstead of--justlaunchios-deploy --id <device-id> --bundle build/ios/iphoneos/Runner.app --debug ... (lldb) connect (lldb) run success 2020-03-17 17:32:39.410811-0700 Runner[633:132633] flutter: Observatory listening on http://127.0.0.1:55084/kiP-Z29onwQ=/Or install and launch just the debugserver with
--nolldband store that port somewhere:ios-deploy --id <device-id> --bundle build/ios/iphoneos/Runner.app --nolldb ... ------------------------- debugserver port: 57168 App path: /private/var/containers/Bundle/Application/666A4C8D-C54D-4C55-8594-1E1FE56406CD/Runner.appThen later attach to that port with
--noinstall(which launches if it's not already running):ios-deploy --id <device-id> --bundle build/ios/iphoneos/Runner.app --noinstall --port 57168 ... (lldb) connect (lldb) run success 2020-03-17 17:35:05.399716-0700 Runner[636:133192] flutter: Observatory listening on http://127.0.0.1:55427/ifXCFq2E91c=/And even when it's running, I was able to print the observatory port for a standard app (the FlutterController wouldn't necessarily be the rootViewController for add-to-app) after interrupting the process (app would be briefly locked until resumed).
(lldb) process interrupt Process 639 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP frame #0: 0x00000001aa144198 libsystem_kernel.dylib`mach_msg_trap + 8 libsystem_kernel.dylib`mach_msg_trap: -> 0x1aa144198 <+8>: ret libsystem_kernel.dylib`mach_msg_overwrite_trap: 0x1aa14419c <+0>: mov x16, #-0x20 0x1aa1441a0 <+4>: svc #0x80 0x1aa1441a4 <+8>: ret Target 0: (Runner) stopped. (lldb) po ((FlutterEngine *)[UIApplication.sharedApplication.keyWindow.rootViewController engine]).observatoryUrl.port 56889 (lldb) process continue Process 639 resumingReacted by Christopher Fujino- addedP2Important issues not at the top of the work listImportant issues not at the top of the work list
on Aug 18, 2020 6 remaining items
How do we get this new build of flutter?
I'm going to reopen this one. #66092 fixed the original issue filed in November 2019, but this issue also became confused with a 1.20 regression where stdout logs aren't being passed along the VM "Stdout" service (which even on #66092 is important for
attachflows)According to my bisect, this regressed with #54132.
Actually, changed my mind. Let's use #65519 to track that regression, so we don't confuse cherry-pickers.
- addedP2Important issues not at the top of the work listImportant issues not at the top of the work listand removedP2Important issues not at the top of the work listImportant issues not at the top of the work list
on Sep 22, 2020 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.- locked as resolved and limited conversation to collaborators
on Aug 12, 2021
Logs are not printed on first build on iOS devices. Works in simulator.
Related: #41133
Reproduce: