However, we enable a lot of other stuff too when _BundlerDebug is enabled, so it would make sense to have a separate opt-in mechanism to enable profiling.
I believe .NET projects in general always include profiling support when they're built (it's enabled at launch using environment variables), so there's no existing project property we can use, but I think it would make sense to share the same property between all mobile platforms, so either of these two comes to mind:
Currently we link with the diagnostics libraries if
_BundleDebug
is true:https://github.com/xamarin/xamarin-macios/blob/f12ba7fcf52cc22980cc1731e42c6bf904594d4a/dotnet/targets/Xamarin.Shared.Sdk.targets#L418
However, we enable a lot of other stuff too when
_BundlerDebug
is enabled, so it would make sense to have a separate opt-in mechanism to enable profiling.Android uses
AndroidEnableProfiler
:https://github.com/xamarin/xamarin-android/blob/d5c4ec09f7658428a10bbe49c8a7a3eb2f71cb86/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets#L216
In Xamarin.iOS, we used
MtouchProfiling
:https://github.com/xamarin/xamarin-macios/blob/f12ba7fcf52cc22980cc1731e42c6bf904594d4a/msbuild/Xamarin.Shared/Xamarin.iOS.Common.targets#L246
For Xamarin.Mac, we used
Profiling
:https://github.com/xamarin/xamarin-macios/blob/f12ba7fcf52cc22980cc1731e42c6bf904594d4a/msbuild/Xamarin.Shared/Xamarin.Mac.Common.targets#L101
although
MtouchProfiling
was also accepted:https://github.com/xamarin/xamarin-macios/blob/f12ba7fcf52cc22980cc1731e42c6bf904594d4a/msbuild/Xamarin.Shared/Xamarin.Mac.Common.props#L49
I believe .NET projects in general always include profiling support when they're built (it's enabled at launch using environment variables), so there's no existing project property we can use, but I think it would make sense to share the same property between all mobile platforms, so either of these two comes to mind:
EnableProfiler
EnableProfiling
CC @jonathanpeppers