Hello Xamarin team,
I am working on Xamarin forms in Visual Studio 2017 Community, and I wanted to check the app performance in the Xamarin Profiler. For that I need to create an .mlpd to check the app performance in the Xamarin Profiler. How can I generate this file?
Use the debug.mono.profile
environment variable to enable the Mono profiler.
The debug.mono.profile system property enables the profiler. It is equivalent to, and uses the same values as, the mono --profile option. (See the mono(1) man page for more information.)
adb shell setprop debug.mono.profile "log:calls,alloc,output=/sdcard/Download/output.mlpd,maxframes=8,calldepth=100"
// Exercise your app...
adb pull /sdcard/Download/prof.mlpd ~/Desktop/
adb shell rm /sdcard/Download/prof.mlpd
adb shell setprop debug.mono.profile ""
// View the results:
`which mprof-report` ~/Desktop/prof.mlpd
Note: .mlpd
files can become huge (not just megabytes, but 10s/100s of gigabytes in size depending upon what options you are using with the "log" profiler, make sure you have the storage available on your device (the Xamarin Profiler streams the log data over TCP and thus does not have this issue)
!Note!: If you are trying to store the mlpd file in a location outside of your app's sandbox, Mono will log the error under the mono-prof
tag. If this is the case, you will need to grant your app write permission (i.e. via Android manifest and runtime permissions) from within the app itself.
[mono-prof] Could not create log profiler output file '/sdcard/Download/output.mlpd': Permission denied
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With