问题
@miguel.de.icaza blogged about using Instruments to profile Mac apps built with Mono. However, that blog post was about executables run from the command line, not about .app bundles.
The key point in the above blog post is that the app must be compiled with the AOT switch so that the static symbols are meaningful to Instruments. We've been trying to use the same approach to run Instruments against a Mac .app bundle, and have run into issues.
We've tried running
~/dev/foo/bin/debug> MONO_ENV_OPTIONS="--debug --aot"
./foo.app/Contents/MacOS/foo
but the app compiles to a .dylib rather than a native executable:
Generating debug symbols: dsymutil /Users/bright/dev/foo/bin/Debug/foo.app/Contents/MonoBundle/foo.exe.dylib
We're unsure how to correctly compile this.
Has anyone managed to get Instruments to work with Xamarin.Mac bundles? This must be a pretty common need.
来源:https://stackoverflow.com/questions/18988498/running-instruments-on-a-xamarin-mac-application-bundle