Skip to content

Global print not getting to Flutter console in Swift plugin code. #13204

Closed

Description

@pq

Steps to Reproduce

Create a swift plugin project.

flutter create -i swift -t plugin print_repro

Modify ios/Classes/SwiftPrintReproPlugin.swift to add a print statement in the handle function, like so:

  public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
    print("hi!")
    result("iOS " + UIDevice.current.systemVersion);
  }

Run.

flutter run or flutter run -v.

Expected output: “hi!” In console but none seen.

Flutter Doctor

$ flutter doctor
[✓] Flutter (on Mac OS X 10.12.6 16G1036, locale en-US, channel master)
    • Flutter at /Users/pquitslund/src/repos/flutter
    • Framework revision d79c12e5b8 (4 days ago), 2017-11-22 17:35:35 +0100
    • Engine revision 93b2179597
    • Tools Dart version 1.25.0-dev.11.0

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.1)
    • Android SDK at /Users/pquitslund/Library/Android/sdk
    • Unable to locate Android NDK.

    • Unable to locate compiler in Android NDK.

    • Platform android-27, build-tools 27.0.1
    • Java binary at: /Applications/Tools/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] iOS toolchain - develop for iOS devices (Xcode 9.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.1, Build version 9B55
    • ios-deploy 1.9.2
    • CocoaPods version 1.3.1

[✓] Android Studio (version 3.0)
    • Android Studio at /Applications/Tools/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b08)

[✓] IntelliJ IDEA Community Edition (version 2017.2.6)
    • Flutter plugin version 19.1
    • Dart plugin version 172.4343.25

[✓] Connected devices
    • iPhone 8 • B9BDC7A5-52E3-46E3-BF70-E7A4B0BFEAAE • ios • iOS 11.1 (simulator)

/cc @cbracken @szakarias

Activity

  1. added
    p: tooling
    platform-ios
    on Nov 27, 2017
  2. pq commented on Nov 27, 2017

    @pq
    ContributorAuthor

    FWIW: NSLOG(..) does work so that's a good interim solution. 👍

  3. szakarias commented on Nov 28, 2017

    @szakarias
    Contributor

    I actually don't know what to expect for print but if you run it from xcode you can see it in the xcode console. Maybe @xster knows more?

  4. pq commented on Nov 28, 2017

    @pq
    ContributorAuthor

    Chatting w/ @cbracken, I think the expectation is that output would make its way to the Flutter console. (FWIW running from Xcode isn't an easy option if you're debugging plugin integration but you're spot on that its handy for what you can test that way, though it may be surprising to see it in the Xcode console but not in Flutter's...) Incidentally, whatever the answer is, it might be good thing to document logging best practices in the plugin development docs (cc @LarkAscending).

  5. cbracken commented on Nov 28, 2017

    @cbracken
    Member

    Flutter console logging relies on device logging which, depending on iOS version, is implemented as syslog, ASL, or os_log. NSLog() (and os_log() on iOS 10 and later) logs to the device logs, which is what flutter bridges to the flutter run output. print and debugPrint don't log to the device log, and therefore don't get bridged across.

    While the behaviour is consistent with native Swift apps from the perspective of where each function logs to, the question is what developers expect. I'd wager most developers will expect output consistent with the Xcode console, not with the device syslog.

    The fix here is most likely to stop relying on device logs for debug printing and instead rely on a more direct bridging mechanism.

    For later reference if we need it, here's the flutter run output I see in verbose mode (and in Console.app) from a series of all four log calls:

    [  +11 ms] [DEVICE LOG] 2017-11-28 12:31:25.436526-0800  localhost Runner[8502]: (libswiftFoundation.dylib) This is an NSLog message
    [  +13 ms] [DEVICE LOG] 2017-11-28 12:35:58.881213-0800  localhost Runner[8502]: This is an os_log message
    
  6. pq commented on Nov 29, 2017

    @pq
    ContributorAuthor

    I'd wager most developers will expect output consistent with the Xcode console, not with the device syslog.

    👍

    This is my thinking exactly. In any event, I think it would be good to document this somewhere.

    FYI @devoncarew who has been thinking about improved logging from the IDE perspective

  7. devoncarew commented on Nov 29, 2017

    @devoncarew
    Contributor

    The fix here is most likely to stop relying on device logs for debug printing and instead rely on a more direct bridging mechanism.

    Sounds great. For logging, I was thinking about log streams that you'd want to enable / disable / filter (to focus in on some things like networking, and reduce the verbosity of others). print should likely just always show to the user :)

    @cbracken, in terms of bridging, we wouldn't necessarily need to do anything iOS specific here. If we have print route it's output to the dart:developer log() call, IDEs (or other) could get those calls via the service protocol and display in the console as if it were print output.

  8. cbracken commented on Dec 1, 2017

    @cbracken
    Member

    To be clear, print here is the Swift function (implemented in libswiftfoundation.dylib), not Dart's core print (whose implementation we have direct control over) so we'll need to do a little bit of poking around to see where it's writing today.

    If print and debugPrint are writing to stdout, that's something we could likely intercept in the engine and forward over the service protocol as you suggest. Agreed we don't want to do something platform-specific here.

    I'd also like to make sure whatever solution we implement doesn't use the current bridging mechanism (logs), since redirecting these calls to logs goes against developer expectations on the platform, and could result in unwittingly logging PII, etc. Forwarding over the service port seems nice -- with the notable exception of the initial logging of the observatory port itself ;-).

  9. abacaj commented on Aug 29, 2018

    @abacaj

    Does anyone know if this is fixed?

    I see no log output using print or NSLog from plugin code.

  10. robsonql commented on Sep 21, 2018

    @robsonql

    Same problem here. Please look at this issue.

  11. added
    engine
    on Sep 21, 2018
  12. jmrboosties commented on Oct 9, 2018

    @jmrboosties

    Would really appreciate if we had a way to see the console on an iOS bridge running Swift. I can't see it in Xcode either which wouldn't be a huge deal for me if that's where the output was found, just right now I can't find it anywhere.

  13. mobiletoly commented on Nov 22, 2018

    @mobiletoly

    print does not work for me. NSLog initially didn't work as well, until I encountered some really odd behavior that makes NSLog to work (well, kind of)

    let kv = [
                "key1": "value1",
                "key2": "value2"
            ]
    NSLog("Test %@ Results -- %@ -- %@ -- %d", [], "HELLO", kv, 999)
    
    

    So square brackets are the key here. "Test" part is not going to be printed but everything after first %@ with associated [] argument - will be printed. Don't ask why :)

  14. 17 remaining items

  15. jmagman commented on Oct 20, 2020

    @jmagman
    Member

    #54781 resolved this in 1.23.0-7.0.pre which is available on the beta channel.

  16. TahaTesser commented on Oct 22, 2020

    @TahaTesser
    Contributor

    Updated
    Confirm it works

    import Flutter
    import UIKit
    
    public class SwiftHelloBetaPlugin: NSObject, FlutterPlugin {
      public static func register(with registrar: FlutterPluginRegistrar) {
        let channel = FlutterMethodChannel(name: "hello_beta", binaryMessenger: registrar.messenger())
        let instance = SwiftHelloBetaPlugin()
        registrar.addMethodCallDelegate(instance, channel: channel)
      }
    
      public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
        print("hi!")
        NSLog("Before\nAfter")
        NSLog("\nHello, World!")
        result("iOS " + UIDevice.current.systemVersion)
      }
    }
    logs
    [ +372 ms] Installing and launching...
    [        ] Debugging is enabled, connecting to observatory
    [   +7 ms] executing: script -t 0 /dev/null
    /Users/tahatesser/Code/flutter_beta/bin/cache/artifacts/ios-deploy/ios-deploy
    --id 00008020-001059882212002E --bundle build/ios/iphoneos/Runner.app --debug
    --no-wifi --args --enable-dart-profiling --enable-service-port-fallback
    --disable-service-auth-codes --observatory-port=61470 --enable-checked-mode
    --verify-entry-points
    [ +275 ms] [....] Waiting for iOS device to be connected
    [  +20 ms] [....] Using 00008020-001059882212002E (N841AP, iPhone XR, iphoneos,
    arm64e) a.k.a. 'Taha’s iPhone'.
    [        ] ------ Install phase ------
    [        ] [  0%] Found 00008020-001059882212002E (N841AP, iPhone XR, iphoneos,
    arm64e) a.k.a. 'Taha’s iPhone' connected through USB, beginning install
    [ +345 ms] [  5%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/META-INF/ to device
    [        ] [  5%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/META-INF/com.apple.ZipMetadata.plist to device
    [        ] [  5%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/_CodeSignature/ to device
    [        ] [  5%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/_CodeSignature/CodeResources to device
    [        ] [  6%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/[email protected] to device
    [        ] [  6%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/[email protected] to device
    [        ] [  6%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/AppIcon29x29.png to device
    [        ] [  6%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/[email protected] to device
    [        ] [  7%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Runner to device
    [        ] [  7%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/[email protected] to device
    [        ] [  7%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/[email protected] to device
    [        ] [  8%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/AppIcon29x29~ipad.png to device
    [        ] [  8%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/[email protected] to device
    [        ] [  8%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/[email protected] to device
    [        ] [  8%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/[email protected] to device
    [        ] [  9%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Base.lproj/ to device
    [        ] [  9%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Base.lproj/Main.storyboardc/ to device
    [        ] [  9%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Base.lproj/Main.storyboardc/UIViewController-BYZ-38-t0r.nib to device
    [   +1 ms] [ 10%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Base.lproj/Main.storyboardc/BYZ-38-t0r-view-8bC-Xf-vdC.nib to device
    [        ] [ 10%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Base.lproj/Main.storyboardc/Info.plist to device
    [        ] [ 10%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Base.lproj/LaunchScreen.storyboardc/ to device
    [        ] [ 10%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Base.lproj/LaunchScreen.storyboardc/01J-lp-oVM-view-Ze5-6b-2t3.nib to
    device
    [        ] [ 11%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Base.lproj/LaunchScreen.storyboardc/UIViewController-01J-lp-oVM.nib to
    device
    [        ] [ 11%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Base.lproj/LaunchScreen.storyboardc/Info.plist to device
    [        ] [ 11%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Assets.car to device
    [        ] [ 11%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/AppFrameworkInfo.plist to device
    [        ] [ 12%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/AppIcon40x40@2x~ipad.png to device
    [        ] [ 12%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/AppIcon76x76@2x~ipad.png to device
    [        ] [ 12%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/AppIcon83.5x83.5@2x~ipad.png to device
    [        ] [ 13%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/AppIcon29x29@2x~ipad.png to device
    [        ] [ 13%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/AppIcon40x40~ipad.png to device
    [        ] [ 13%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/ to device
    [        ] [ 13%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftCoreImage.dylib to device
    [  +16 ms] [ 14%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftObjectiveC.dylib to device
    [  +98 ms] [ 14%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftCore.dylib to device
    [+2673 ms] [ 19%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftCoreGraphics.dylib to device
    [ +130 ms] [ 19%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftUIKit.dylib to device
    [  +72 ms] [ 20%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftMetal.dylib to device
    [  +77 ms] [ 20%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftDispatch.dylib to device
    [ +182 ms] [ 21%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftos.dylib to device
    [  +40 ms] [ 21%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftCoreFoundation.dylib to device
    [  +71 ms] [ 21%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/Flutter.framework/ to device
    [        ] [ 22%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/Flutter.framework/_CodeSignature/ to device
    [        ] [ 22%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/Flutter.framework/_CodeSignature/CodeResources to device
    [   +1 ms] [ 22%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/Flutter.framework/icudtl.dat to device
    [ +128 ms] [ 23%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/Flutter.framework/Flutter to device
    [+3573 ms] [ 30%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/Flutter.framework/Info.plist to device
    [        ] [ 30%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/ to device
    [        ] [ 30%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/_CodeSignature/ to device
    [        ] [ 30%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/_CodeSignature/CodeResources to device
    [        ] [ 31%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/App to device
    [        ] [ 31%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/ to device
    [        ] [ 31%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/vm_snapshot_data to device
    [        ] [ 32%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/isolate_snapshot_data to device
    [ +510 ms] [ 33%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/AssetManifest.json to device
    [   +1 ms] [ 33%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/kernel_blob.bin to device
    [+3557 ms] [ 40%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/NOTICES to device
    [  +91 ms] [ 40%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/FontManifest.json to device
    [   +1 ms] [ 40%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/packages/ to device
    [        ] [ 41%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/packages/cupertino_icons/ to
    device
    [        ] [ 41%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/packages/cupertino_icons/assets
    / to device
    [        ] [ 41%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/packages/cupertino_icons/assets
    /CupertinoIcons.ttf to device
    [  +27 ms] [ 41%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/fonts/ to device
    [   +1 ms] [ 42%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/flutter_assets/fonts/MaterialIcons-Regular.otf
    to device
    [ +129 ms] [ 42%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/App.framework/Info.plist to device
    [        ] [ 42%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftDarwin.dylib to device
    [  +66 ms] [ 43%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/hello_beta.framework/ to device
    [   +1 ms] [ 43%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/hello_beta.framework/_CodeSignature/ to device
    [        ] [ 43%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/hello_beta.framework/_CodeSignature/CodeResources to device
    [        ] [ 44%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/hello_beta.framework/hello_beta to device
    [  +38 ms] [ 44%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/hello_beta.framework/Info.plist to device
    [        ] [ 44%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftQuartzCore.dylib to device
    [  +35 ms] [ 45%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftCoreAudio.dylib to device
    [  +50 ms] [ 45%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftFoundation.dylib to device
    [+1368 ms] [ 47%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Frameworks/libswiftCoreMedia.dylib to device
    [  +47 ms] [ 48%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/AppIcon20x20~ipad.png to device
    [        ] [ 48%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/embedded.mobileprovision to device
    [        ] [ 48%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/AppIcon20x20@2x~ipad.png to device
    [        ] [ 49%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/Info.plist to device
    [        ] [ 49%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/PkgInfo to device
    [        ] [ 49%] Copying
    /Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/Ru
    nner.app/AppIcon76x76~ipad.png to device
    [ +358 ms] [ 52%] CreatingStagingDirectory
    [        ] [ 57%] ExtractingPackage
    [        ] [ 60%] InspectingPackage
    [  +22 ms] [ 60%] TakingInstallLock
    [  +52 ms] [ 65%] PreflightingApplication
    [  +37 ms] [ 65%] InstallingEmbeddedProfile
    [  +22 ms] [ 70%] VerifyingApplication
    [ +243 ms] [ 75%] CreatingContainer
    [   +7 ms] [ 80%] InstallingApplication
    [   +6 ms] [ 85%] PostflightingApplication
    [   +3 ms] [ 90%] SandboxingApplication
    [  +15 ms] [ 95%] GeneratingApplicationMap
    [  +69 ms] [100%] Installed package build/ios/iphoneos/Runner.app
    [ +399 ms] ------ Debug phase ------
    [        ] Starting debug of 00008020-001059882212002E (N841AP, iPhone XR,
    iphoneos, arm64e) a.k.a. 'Taha’s iPhone' connected through USB...
    [ +134 ms] [  0%] Looking up developer disk image
    [  +16 ms] [ 95%] Developer disk image mounted successfully
    [+1082 ms] [100%] Connecting to remote debug server
    [        ] -------------------------
    [+2175 ms] (lldb) command source -s 0
    '/tmp/248F8998-7BFF-46FF-9FC1-2FE7A48B07AC/fruitstrap-lldb-prep-cmds-00008020_00
    1059882212002E'
    [        ] Executing commands in
    '/tmp/248F8998-7BFF-46FF-9FC1-2FE7A48B07AC/fruitstrap-lldb-prep-cmds-00008020_00
    1059882212002E'.
    [        ] (lldb)     platform select remote-ios --sysroot
    '/Users/tahatesser/Library/Developer/Xcode/iOS DeviceSupport/14.1 (18A8395)
    arm64e/Symbols'
    [        ]   Platform: remote-ios
    [        ]  Connected: no
    [        ]   SDK Path: "/Users/tahatesser/Library/Developer/Xcode/iOS
    DeviceSupport/14.1 (18A8395) arm64e/Symbols"
    [        ] (lldb)     target create
    "/Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/R
    unner.app"
    [+4225 ms] Current executable set to
    '/Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos/R
    unner.app' (arm64).
    [        ] (lldb)     script
    fruitstrap_device_app="/private/var/containers/Bundle/Application/457A62AD-8ABA-
    4AA6-A5CA-035F86837A62/Runner.app"
    [ +470 ms] (lldb)     script fruitstrap_connect_url="connect://127.0.0.1:63837"
    [        ] (lldb)     script fruitstrap_output_path=""
    [        ] (lldb)     script fruitstrap_error_path=""
    [        ] (lldb)     target modules search-paths add /usr
    "/Users/tahatesser/Library/Developer/Xcode/iOS DeviceSupport/14.1 (18A8395)
    arm64e/Symbols/usr" /System "/Users/tahatesser/Library/Developer/Xcode/iOS
    DeviceSupport/14.1 (18A8395) arm64e/Symbols/System"
    "/private/var/containers/Bundle/Application/457A62AD-8ABA-4AA6-A5CA-035F86837A62
    "
    "/Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos"
    "/var/containers/Bundle/Application/457A62AD-8ABA-4AA6-A5CA-035F86837A62"
    "/Users/tahatesser/AndroidStudioProjects/hello_beta/example/build/ios/iphoneos"
    /Developer "/Users/tahatesser/Library/Developer/Xcode/iOS DeviceSupport/14.1
    (18A8395) arm64e/Symbols/Developer"
    [  +15 ms] (lldb)     command script import
    "/tmp/248F8998-7BFF-46FF-9FC1-2FE7A48B07AC/fruitstrap_00008020_001059882212002E.
    py"
    [   +4 ms] (lldb)     command script add -f
    fruitstrap_00008020_001059882212002E.connect_command connect
    [        ] (lldb)     command script add -s asynchronous -f
    fruitstrap_00008020_001059882212002E.run_command run
    [        ] (lldb)     command script add -s asynchronous -f
    fruitstrap_00008020_001059882212002E.autoexit_command autoexit
    [        ] (lldb)     command script add -s asynchronous -f
    fruitstrap_00008020_001059882212002E.safequit_command safequit
    [        ] (lldb)     connect
    [  +73 ms] (lldb)     run
    [ +298 ms] success
    [        ] Application launched on the device. Waiting for observatory port.
    [  +17 ms] Attempting to forward device port 61470 to host port 63844
    [        ] executing:
    /Users/tahatesser/Code/flutter_beta/bin/cache/artifacts/usbmuxd/iproxy
    63844:61470 --udid 00008020-001059882212002E
    [+1026 ms] Forwarded port ForwardedPort HOST:63844 to DEVICE:61470
    [ +205 ms] Installing and launching... (completed in 24.7s)
    [   +3 ms] Caching compiled dill
    [  +61 ms] Connecting to service protocol: http://localhost:63844
    [   +1 ms] Launching a Dart Developer Service (DDS) instance at
    http://127.0.0.1:0, connecting to VM service at http://localhost:63844.
    [ +121 ms] DDS is listening at http://127.0.0.1:63848/QqgTcXI0-KQ=/.
    [  +17 ms] hi!
    [        ] Before
    [        ] After
    [        ] Hello, World!
    [  +66 ms] Successfully connected to service protocol: http://localhost:63844
    [   +1 ms] Waiting for Taha’s iPhone to report its views...
    [   +6 ms] Waiting for Taha’s iPhone to report its views... (completed in 5ms)
    [   +6 ms] DevFS: Creating new filesystem on the device (null)
    [  +17 ms] DevFS: Created new filesystem on the device
    (file:///private/var/mobile/Containers/Data/Application/F4C192CF-F711-438D-B268-
    0165057E3CEE/tmp/exampleIBJEVI/example/)
    [   +5 ms] Updating assets
    [ +126 ms] Syncing files to device Taha’s iPhone...
    [   +1 ms] <- reset
    [        ] Compiling dart to kernel with 0 updated files
    [   +2 ms] <- recompile package:hello_beta_example/main.dart
    e22c5fa5-9955-48b8-b918-d000fc99b56f
    [        ] <- e22c5fa5-9955-48b8-b918-d000fc99b56f
    [  +48 ms] Updating files.
    [        ] DevFS: Sync finished
    [        ] Syncing files to device Taha’s iPhone... (completed in 54ms)
    [        ] Synced 0.0MB.
    [        ] <- accept
    [   +3 ms] Connected to _flutterView/0x10b01a020.
    [   +1 ms] Flutter run key commands.
    [   +1 ms] r Hot reload. 🔥🔥🔥
    [        ] R Hot restart.
    [        ] h Repeat this help message.
    [        ] d Detach (terminate "flutter run" but leave application running).
    [        ] c Clear the screen
    [        ] q Quit (terminate the application on the device).
    [        ] An Observatory debugger and profiler on Taha’s iPhone is available
    at:
               http://127.0.0.1:63848/QqgTcXI0-KQ=/
    
    
    flutter doctor -v
    [✓] Flutter (Channel beta, 1.23.0-18.1.pre, on Mac OS X 10.15.7 19H2 x86_64,
        locale en-GB)
        • Flutter version 1.23.0-18.1.pre at /Users/tahatesser/Code/flutter_beta
        • Framework revision 198df796aa (7 days ago), 2020-10-15 12:04:33 -0700
        • Engine revision 1d12d82d9c
        • Dart version 2.11.0 (build 2.11.0-213.1.beta)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
        • Android SDK at /Users/tahatesser/Code/sdk
        • Platform android-30, build-tools 30.0.2
        • ANDROID_HOME = /Users/tahatesser/Code/sdk
        • Java binary at: /Applications/Android
          Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6222593)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 12.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.1, Build version 12A7403
        • CocoaPods version 1.10.0.rc.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.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
          1.8.0_242-release-1644-b3-6222593)
    
    [✓] VS Code (version 1.50.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.15.1
    
    [✓] Connected device (4 available)
        • Taha’s iPhone (mobile) • 00008020-001059882212002E            • ios
          • iOS 14.1
        • iPhone 12 (mobile)     • 722C6A4C-3FCA-4FC6-9D30-9702A0E784B8 • ios
          • com.apple.CoreSimulator.SimRuntime.iOS-14-1 (simulator)
        • Web Server (web)       • web-server                           •
          web-javascript • Flutter Tools
        • Chrome (web)           • chrome                               •
          web-javascript • Google Chrome 86.0.4240.80
    
    • No issues found!
    flutter doctor -v
    [✓] Flutter (Channel master, 1.24.0-2.0.pre.111, on Mac OS X 10.15.7 19H2
        darwin-x64, locale en-GB)
        • Flutter version 1.24.0-2.0.pre.111 at
          /Users/tahatesser/Code/flutter_master
        • Framework revision fe189baf34 (10 hours ago), 2020-10-21 22:25:53 -0400
        • Engine revision f459a86610
        • Dart version 2.11.0 (build 2.11.0-242.0.dev)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
        • Android SDK at /Users/tahatesser/Code/sdk
        • Platform android-30, build-tools 30.0.2
        • ANDROID_HOME = /Users/tahatesser/Code/sdk
        • Java binary at: /Applications/Android
          Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6222593)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 12.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.1, Build version 12A7403
        • CocoaPods version 1.10.0.rc.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.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
          1.8.0_242-release-1644-b3-6222593)
    
    [✓] VS Code (version 1.50.1)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.15.1
    
    [✓] Connected device (5 available)
        • Taha’s iPhone (mobile) • 00008020-001059882212002E            • ios
          • iOS 14.1
        • iPhone 12 (mobile)     • 722C6A4C-3FCA-4FC6-9D30-9702A0E784B8 • ios
          • com.apple.CoreSimulator.SimRuntime.iOS-14-1 (simulator)
        • macOS (desktop)        • macos                                • darwin-x64
          • Mac OS X 10.15.7 19H2 darwin-x64
        • Web Server (web)       • web-server                           •
          web-javascript • Flutter Tools
        • Chrome (web)           • chrome                               •
          web-javascript • Google Chrome 86.0.4240.80
    
    • No issues found!
    
  17. jmagman commented on Oct 22, 2020

    @jmagman
    Member

    @TahaTesser Your logs show:

    [  +17 ms] hi!
    [        ] Before
    [        ] After
    [        ] Hello, World!
    

    If you run without -v it might be more obvious.

  18. TahaTesser commented on Oct 22, 2020

    @TahaTesser
    Contributor

    @jmagman
    oops, I was expecting them at the end of the logs, silly me

  19. jmagman commented on Oct 22, 2020

    @jmagman
    Member

    @TahaTesser Yeah ideally it would buffer those pre-VM (dart) logs and show them right before. Feel free to file an issue to improve this experience.

  20. matthewjs commented on Mar 9, 2021

    @matthewjs

    This still does not work as of flutter 2. The os_log statements show up in flutter logs, but not in the flutter console. Any ideas?

  21. jmagman commented on Mar 9, 2021

    @jmagman
    Member

    os_log statements show up in flutter logs, but not in the flutter console

    Can you be more specific? What does that mean? Filing a new bug and completely filling out the template is your best bet.

  22. matthewjsummers commented on Mar 9, 2021

    @matthewjsummers

    When running flutter in debug on iOS simulator via flutter run, any os_log statements executed natively from swift do not show up in the flutter console when debugging.

    When running flutter logs these statements do show up, but not in the console. Running on an android simulator is fine as it appears logcat output is directed to the console.

    An happy to file a bug if required, I just thought it might be quicker to add to this existing issue in case there was something I’m not doing correctly.

  23. jmagman commented on Mar 9, 2021

    @jmagman
    Member

    @matthewjsummers What do you mean by "console"? The output in terminal when you flutter run? Or in an IDE session?

    flutter run in terminal should be showing the output from an attached lldb debugging session, so should include os_log output. flutter log doesn't have an attached debugging session, but is getting those logs from the VM service. So I would actually expect the opposite of what you described.

    An happy to file a bug if required, I just thought it might be quicker to add to this existing issue in case there was something I’m not doing correctly.

    File a new bug, I want to take a look! Please completely fill lout the template, and include a flutter run output with the --verbose flag (it's large, you may need to attach it).

  24. point-source commented on Jun 4, 2021

    @point-source

    I also have not been able to get any output from swift print/NSLog. @matthewjsummers did you ever file a new report? If so, where is it?

    The only related issue I can find is #69103 but the issue I'm having is that nothing prints.

  25. jmagman commented on Jun 5, 2021

    @jmagman
    Member

    @point-source Can you file a new issue with the requested info?

  26. github-actions commented on Jul 31, 2021

    @github-actions

    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 -v and a minimal reproduction of the issue.

  27. locked as resolved and limited conversation to collaborators on Jul 31, 2021
  28. added
    package
    on Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2customer: crowdenginefound in release: 1.22has reproducible stepsp: toolingpackageplatform-ios

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions