How to make .NET MAUI to show logs from native code

Wei Wen 1,126 Reputation points
2022-11-04T02:03:23.727+00:00

I included custom native Android and iOS libraries in my .NET MAUI app. The native libraries are supposed to spit out log information when certain activities occur. I want to be able to see the log information in Visual Studio. Is it possible?

I also included the same libraries in Flutter and React Native apps. In Flutter, I can see the log information from the native libraries in VSCode. In React Native, although I cannot see native library logs in VSCode, I can load the native parts of the app in Xcode and Android. When running in Xcode and Android Studio, I can still see logs. .NET MAUI or Xamarin does not seem to provide such a facility. Is it so?

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,126 Reputation points Microsoft External Staff
    2022-11-07T05:31:38.427+00:00

    Hello,

    You could refer to this documentation to get the details about how to get the logs on Android and iOS.

    Crash logs and the output of the Console class will be sent to the iPhone console. You can access this console with Xcode using the "Organizer" and selecting your device from the organizer.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.