deploy gtk on mac

It turns out the standard mono distribution offers a command line utility designed for this exact purpose. While I didn’t create a MonoMac project, I was able to package my GUI application relying on Gtk# rather effectively.
This command line utility called macpack
is extremely simple to use, just point him to the direction of the files you want to package, specify the name of the assembly containing the Main
method and you’re good to go.
macpack [options] assembly -n appname -appname:appname Application Name -o output -output:OUTPUT Output directory -a assembly Assembly to pack -i file -icon file Icon filename -r resource1,resource2 Additional files to bundle -m [winforms|cocoa|x11|console] The mode for the applicatio

This is the line I used to compile a little test project:
macpack -o:. -w:winforms -r:/Library/Frameworks/Mono.framework/Versions/Current/lib/ -r:GtkMacTest.exe.mdb -n:GtkMacTest -a:GtkMacTest.exe

The -w:winforms
was a bit of a shot in the dark as there is now Gtk specific option… in the end it worked out well.
I didn’t experiment with the -i
option, so the resulting package looks rather ugly with the default icon on, but I’ll look into that another day. For now, all that matters is that I created a working .app to distribute the project.


Xamarin Studio will run that EXE with the Mono runtime. You would either have to create .app with macpack or maybe follow these instructions.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容