Xamarin.Forms - Debug.WriteLine() - where does the output go?

29,985

Solution 1

Using Console.WriteLine() works with Device Log. Also you can filter out all device log with mono-stdout tag.

Solution 2

Rider has a plugin called Logcat, when I write

Console.WriteLine("**** Hi mate");

, then I can filter the Logcat window for **** and it will show the Console.WriteLine's

This is in Xamarin Forms, for both iOS and Android

Solution 3

It should be on the device log, for example on Android you can use the Android Device Monitor to see the message, You can always use Console.Writeline() to see those messages on the debug console.

Solution 4

It will be coming in application output window. if it is not open automatically, you can go to view -> Pads -> Application Output. This was about mac visual studio. i am not sure about windows.

Share:
29,985
jbyrd
Author by

jbyrd

Updated on July 09, 2022

Comments

  • jbyrd
    jbyrd almost 2 years

    I have a simple Xamarin.Forms project that I'm running in Visual Studio, using an iphone emulator. I have the following code in App.cs:

    protected override void OnStart()
    {
        Debug.WriteLine("---------- OnStart called!");
    }
    

    Where exactly is that supposed to output to? I don't see it in any of the Visual Studio output windows (Build, Build Order, Debug, Xamarin, Xamarin Diagnostics).

  • jbyrd
    jbyrd over 8 years
    Hmm, ok - what library do I need to include ("using xyz...") to use Console?
  • Mario Galván
    Mario Galván over 8 years
    Console.WriteLine("True!"); I think is using System;
  • jbyrd
    jbyrd over 8 years
    I thought so, but I have using System - but Console still is not recognized for some reason.
  • Mario Galván
    Mario Galván over 8 years
    Are you using PCL or Shared project?
  • Mario Galván
    Mario Galván over 8 years
    Oooh, then you must use Debug.WriteLine, and it will pop up inside Application Output.
  • jbyrd
    jbyrd over 8 years
    I see - where is Application Output? That option does not show up in the list in the output window ("Show output from:") - only Build, Build Order, Debug, Xamarin, and Xamarin Diagnostics.
  • Mario Galván
    Mario Galván over 8 years
    Debug is not showing anything? it should print 2 lines on the console.
  • jbyrd
    jbyrd over 8 years
    Silly me, I figured it out - I was running the application without debug (Ctrl+F5) instead of with debug (F5). Doh!
  • Paul
    Paul about 5 years
    The name Console does not exist in the current context though.
  • Max
    Max about 4 years
    Then just start using System;
  • testing
    testing over 2 years
    Is it possible to use it's own Tag? How?