Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IL2CPP vs Mono2x and Android deployment

Tags:

c#

unity3d

il2cpp

IL2CPP is a Unity-developed scripting back-end which you can use as an alternative to Mono when building projects for some platforms.Note - IL2CPP is only available when building for the following platforms:

  • Android AppleTV, iOS*, Nintendo 3DS, Nintendo Switch, Playstation 4 Playstation Vita, WebGL* ,Windows Store, Xbox One

I have a project(unity 5.2) which has switched for Android deployment. I tried to switch my scripting backed from Mono2x to IL2CPP and its showing me that

IL2CPP on Andriod is experimental and unsupported

So, my simple question is that if it is still not supported then why the option has included, what is the fundamental difference between IL2CPP and Mono2x. Why I switched to IL2CPP scripting backend ?

I have also checked in unity 5.5.2 there is not IL2CPP option in windows platform deployment.

like image 864
Muhammad Faizan Khan Avatar asked Apr 29 '17 05:04

Muhammad Faizan Khan


People also ask

Is IL2CPP better than Mono?

IL2CPP greatly improves performance vs Mono, but still has a lot of legacy (Boehm garbage collector) and doesn't make C++/C# interop easier. What the world really needed was C++ code that can just call into . NET and vice-versa, without requiring huge non-standard C++ extensions.

Is IL2CPP faster?

In Unity 2021.2, IL2CPP enhances calls to this method, so that they occur more than 100 times faster.

What is IL2CPP?

IL2CPP (Intermediate Language To C++) is a Unity-developed scripting backend. The IL2CPP backend converts MSIL (Microsoft Intermediate Language) code (for example, C# code in scripts) into C++ code, then uses the C++ code to create a native binary file (for example, .exe, . apk, or . xap) for your chosen platform.

What is Linux build support Mono vs IL2CPP?

Mono compiles your builds quicker whereas IL2CPP takes a loooooooong time, but IL2CPP can make your game more secure and more performant. If you plan to publish on the Google Play Store, Google will prompt you to submit an IL2CPP build file instead of a mono file for this reason.


1 Answers

Information is based on Unity version 2018.2:

IL2CPP (Intermediate Language To C++) is a Unity-developed scripting backend which you can use as an alternative to Mono when building projects for various platforms. IL2CPP (An ahead-of-time (AOT) compiler) supports debugging of managed code in the same way as the Mono scripting backend.

When building a project using IL2CPP, Unity converts IL code from scripts and assemblies to C++, before creating a native binary file (.exe, apk, .xap, for example) for your chosen platform. Some of the uses for IL2CPP include increasing the performance, security, and platform compatibility of your Unity projects.

Each Scripting Backend has benefits and drawbacks that should influence your decision on which is the right choice for your situation:

IL2CPP:

  • Code generation is heavily improved compared to Mono.
  • Debugging Script code in C++ from top to bottom is possible.
  • You can enable Engine code stripping to reduce code size.
  • Build times are longer than with Mono.
  • Only supports Ahead of Time (AOT) compilation.

Mono:

  • Faster build times than IL2CPP.
  • Supports more managed libraries due to Just In Time compilation (JIT).
  • Supports runtime code execution.
  • Must ship managed assemblies (.dll files that mono- or .net produce).

IMP Points:

  • The default Target Architecture in the Android Player Settings are armv7 and x86 with the IL2CPP and Mono Scripting Backend.

  • Mono is not supported on UWP or iOS 11 and above. The default Architecture in the iOS Player Settings are armv7 and arm64 with the IL2CPP Scripting Backend.

  • UWP build only support IL2CPP and .NET, The .NET scripting backend (Deprecated ) uses Microsoft’s .NET to power scripting.

like image 62
Sanket Prabhu Avatar answered Oct 02 '22 12:10

Sanket Prabhu