xamarin-android/build-tools/xa-prep-tasks
Marek Habersack 791fedb57c
[Xamarin.Android.Build.Tasks] Add `RunWithLogging` target (#8324)
We are frequently faced with the need to look at some detailed
information optionally logged by our runtime (as well as by the
MonoVM runtime in dotnet/runtime), and in order to obtain the necessary
data, we ask our users to perform a series of steps on the command line.

This is a task we can easily wrap in a nice target, so that instead
of having to type 5 lines of commands the user instead invokes a
single command which will do the rest for them:

	dotnet build -t:RunWithLogging

The above command will:

 1. Set the `debug.mono.log` Android system property
 2. increase the `adb logcat` buffer size
 3. clear the `adb logcat` buffer,
 4. start the application waiting for it to be fully started
 5. pause for 1s
 6. dump the `adb logcat` buffer to a file.
 7. Print a message mentioning where the `adb logcat` output is.

The `$(RunLogVerbose)` MSBuild property can be used to increase
verbosity.  By default the `RunWithLogging` target will set
the `debug.mono.log` system property to:

	default,assembly,timing=bare

When `$(RunLogVerbose)`=true, `debug.mono.log` is instead set to:

	default,assembly,timing=bare,mono_log_level=debug,mono_log_mask=all

The `$(RunLogDelayInMS)` MSBuild property can be used to override the
pause in step (5).

The `$(_RunLogFilePath)` MSBuild property controls the output filename;
by default it is `$(IntermediateOutputPath)logcat.txt`.
2023-09-21 17:49:11 -04:00
..
Xamarin.Android.BuildTools.PrepTasks [Xamarin.Android.Build.Tasks] Add `RunWithLogging` target (#8324) 2023-09-21 17:49:11 -04:00
xa-prep-tasks.csproj [Xamarin.Android.Build.Tasks] Add `RunWithLogging` target (#8324) 2023-09-21 17:49:11 -04:00