Xamarin.Forms - Debug.WriteLine() - where does the output go?
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.
jbyrd
Updated on July 09, 2022Comments
-
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 over 8 yearsHmm, ok - what library do I need to include ("using xyz...") to use Console?
-
Mario Galván over 8 years
Console.WriteLine("True!");
I think isusing System;
-
jbyrd over 8 yearsI thought so, but I have using System - but Console still is not recognized for some reason.
-
Mario Galván over 8 yearsAre you using PCL or Shared project?
-
Mario Galván over 8 yearsOooh, then you must use Debug.WriteLine, and it will pop up inside Application Output.
-
jbyrd over 8 yearsI 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 over 8 yearsDebug is not showing anything? it should print 2 lines on the console.
-
jbyrd over 8 yearsSilly me, I figured it out - I was running the application without debug (Ctrl+F5) instead of with debug (F5). Doh!
-
Paul about 5 yearsThe name
Console
does not exist in the current context though. -
Max about 4 yearsThen just start
using System;
-
testing over 2 yearsIs it possible to use it's own Tag? How?