pra*_*H M 3 c# xaml visual-studio xamarin xamarin.forms
您好Xamarin小组,
我正在Visual Studio 2017社区中处理Xamarin表单,我想检查Xamarin分析器中应用程序的性能。为此,我需要创建.mlpd来
检查xamairn分析器中的应用程序性能。如何创建或生成.mlpd文件。任何帮助,将不胜感激。谢谢praveen
使用debug.mono.profile环境变量启用Mono分析器。
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
Run Code Online (Sandbox Code Playgroud)
注意:.mlpd文件可能会变得很大(不仅是兆字节,而且还会是10s / 100s千兆字节大小,具体取决于您在“ log”事件探查器中使用的选项,请确保您的设备上有可用的存储空间(Xamarin Profiler会流式传输日志) TCP上的数据,因此不存在此问题)
!注意!:如果您试图将mlpd文件存储在应用程序沙箱以外的位置,Mono会将错误记录在mono-prof标记下。在这种情况下,您将需要从应用程序本身内部授予应用程序写权限(即通过Android清单和运行时权限)。
[mono-prof] Could not create log profiler output file '/sdcard/Download/output.mlpd': Permission denied
Run Code Online (Sandbox Code Playgroud)