Linux users who want to run Windows applications without switching operating systems have been able to do so for years with Wine, software that lets apps designed for Windows run on Unix-like systems. The Mac-on-Linux project can run OS X apps, but it requires a PowerPC, not an x86. Virtualizing and emulating are inefficient, especially given the wonderful results the WINE project has had in getting Windows apps to run on Linux.
This page is likely outdated (last edited on 14 Apr 2012). Visit the new documentation for updated content.
Basic usage
The normal way to run an application you have compiled with Mono would be to invoke it through the Mono runtime, like this:
Mono includes two execution systems: Can i delete photos app from mac.
With the mono JIT default, not all optimizations are turned on, since some of them can be quite time consuming. However, when using it in batch mode, it is recommended that you use the
-O=all switch to improve the code generation, for example:
The above will leave the native version of the code in `library.dll.so’. See the page on AOT for more details.
Shell Scripts
However, there are two things you can do to make it more convenient to run Mono applications. The first is to use a shell script instead of the EXE file. For example, if you had “myprogram.exe” you could create a shell script called “myprogram” that had the contents:
Open window apps on mac. When you run “myprogram,” the shell will replace $@ with any arguments you provided.
If you installed mono to a different location, substitute that for /usr/bin/mono. You can check with the “which mono” command.
See also Application Deployment Layout Guidelines.
Registering .exe as non-native binaries (Linux only)
Because this is a Linux-specific feature, we do not recommend that developers deploy this solution, as it would limit the portability of their scripts.
In addition, this mechanism does not work as intended by the Application Deployment Guidelines.
You can also make a systemwide change, and use binfmt to register the exe files as non-native binaries. Then, when trying to launch an exe file, the kernel will run the mono interpreter to handle the command. Binfmt can also be used to launch Windows executables using WINE, or Java .class files using a JVM. To register exe with the kernel:
Blizzard app download mac. In addition, you may want to add that command to your /etc/rc.local boot script, so that it will be executed on boot.
Note that this doesn’t change your kernel, just the modules that it loads when you boot your system. In other words, you can still upgrade your kernel without worrying about losing these changes. Similarly, you can upgrade your Mono runtime without affecting any of the invocation methods listed in this section.
Linux Mint App ListBundles
mkbundle generates an executable program that will contain static copies of the assemblies listed on the command line.
By default only the assemblies specified in the command line will be included in the bundle. To automatically include all of the dependencies referenced, use the “–deps” command line option.
Run Mac Apps On Linux Mint Linux
For example, to create a bundle for hello world, use the following command:
The resulting executable is self contained and does not need the Mono runtime installed to run. However, if your application relies on libraries linked to by the mono runtime or Gtk#, those will need to be installed (Gtk# helper libraries come to mind).
An example with a slightly more complex application (with the same mkbundle options) which uses Gtk# and misc assemblies:
Make app default mac. The -z option allows you to compress the assemblies included in the bundle, and reduce the disk space consumed.
Run Mac Apps On Linux Mint Desktop
The -c option will create a host.c file which contains the main function of the program, which you can modify before compiling and linking the application.
With -c, the further option –nomain will generate the host.c file without a main method so that you can embed it as a library in an existing native application in which you are embedding the Mono runtime yourself. Just call mono_mkbundle_init() before initializing the JIT to make the bundled assemblies available.
Bundles in addition support a –static flag. The –static flag causes mkbundle to generate a static executable that statically links the Mono runtime. Be advised that this option will trigger the LGPL requirement that you still distribute the independent pieces to your user so he can manually upgrade his Mono runtime if he chooses to do so. Alternatively, you can obtain a proprietary license of Mono by contacting Xamarin.
macpack (Mac OS X only)
macpack is a tool that must be used to bundle Cocoa# applications into Double-Clickable, Finder friendly, bundles on Mac OS X. It bundles static libraries and resources, as well as generates a basic info.plist into the .app bundle.
For example the following commands are used to build the CurrencyConverter.exe into an application bundle:
The resulting CurrencyConverter.app is just another Mac OS X application as far as the Finder is concerned, and can be opened from Finder, or launched from Terminal using the open -a CurrencyConverter command.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |