Muhammad Faizan Khan
Muhammad Faizan Khan

Reputation: 10571

IL2CPP vs Mono2x and Android deployment

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:

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.

Upvotes: 7

Views: 14582

Answers (1)

Sanket Prabhu
Sanket Prabhu

Reputation: 2232

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 (Universal Windows Platform) 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.

Note that even without supporting "UWP", because Windows ships old redists, Game and/or Project-release should run on Windows 10 and 11 versions without issue.

But only supporting UWP could be an issue, meaning Project-release may not run on older Windows versions.

Upvotes: 9

Related Questions