你好Xamarin团队,
我正在Visual Studio 2017社区中处理Xamarin表单,我想检查Xamarin分析器中的应用程序性能。为此,我需要创建.mlpd 检查xamairn profiler中的应用程序性能。如何创建或生成.mlpd文件。任何帮助,将不胜感激。谢谢praveen
使用debug.mono.profile
环境变量启用Mono Profiler。
debug.mono.profile系统属性启用了探查器。它等同于,并使用与mono --profile选项相同的值。 (有关更多信息,请参见mono(1)手册页。)
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
注意:.mlpd
文件可能变得很大(不仅仅是兆字节,而是10s / 100s千兆字节,具体取决于您使用“日志”分析器的选项,确保您的设备上有可用的存储(Xamarin Profiler流式传输)通过TCP记录数据,因此没有此问题)
!注意!:如果您尝试将mlpd文件存储在应用程序沙箱之外的位置,Mono将在mono-prof
标记下记录错误。如果是这种情况,您需要从应用程序本身授予您的应用程序写入权限(即通过Android清单和运行时权限)。
[mono-prof] Could not create log profiler output file '/sdcard/Download/output.mlpd': Permission denied