Search Unity

Official Linux IL2CPP Support

Discussion in 'Unity Build Automation' started by branwenevans, Mar 20, 2023.

  1. branwenevans

    branwenevans

    Unity Technologies

    Joined:
    Mar 28, 2017
    Posts:
    7
    We’re happy to share that Unity Build Automation now supports building Linux targets using the IL2CPP scripting backend.

    Currently Linux target builds (using either Mono or IL2CPP as the scripting backend) are only supported on the Mac Builder operating system (OS). Later this year we plan to enable support for Linux targets on Windows OS Builders - we’ll share more on that later in the year.

    Since we’re not building Linux targets natively on Linux OS, this feature is not supported on all Unity versions - you’ll only be able to build for Linux using IL2CPP on Unity 2020 or above*. It’s recommended that you use the latest version of 2020 LTS, 2021 LTS, or 2022 Tech Stream.

    To build your Linux project with IL2CPP you’ll need to do a few things (more details on this at the end of the post):
    • Set your project’s scripting Backend to IL2CPP in the Unity editor
    • Add the com.unity.toolchain.macos-x86_64-linux-x86_64 cross-compilation package to your project - this is necessary since your Linux build will run on a Mac OS builder
    • Make sure that these changes are checked into your source control

    *In most cases, Linux IL2CPP should work on 2019.4+ versions of Unity. However, we saw occasional unexpected behavior in our testing of 2019.4 - we didn’t want this to delay sharing this feature, so the official recommendation is that you don’t use 2019.4 and use 2020+ instead.


    IL2CPP Support for Windows and Mac targets

    Since we’re on the topic of IL2CPP: Unity Build Automation already supports building Windows and Mac targets using IL2CPP as the scripting backend. In order for this to work, you’ll need to make sure that you select the appropriate Builder OS when configuring your build target:

    When building Mac targets with IL2CPP, set the Building operating system (OS) to Mac.

    When building Windows targets with IL2CPP, set the Building operating system (OS) to Windows.


    Details on how to update your Linux Project to use IL2CPP

    Changing your Scripting Backend to IL2CPP:
    Open your project in Unity. Click on Edit and select Project Settings.



    Within Project Settings, navigate to the Player section.
    Expand Other Settings under the Settings for Windows, Max, Linux tab.



    Under Configuration select IL2CPP from the Scripting Backend dropdown.



    Adding the cross-compilation toolchain package via Package Manager:
    If you meet the prerequisites, Unity may prompt to automatically install this package for you when you choose the Linux build target.

    To manually install the toolchain via Package Manager, click the + icon and Add package from Git URL…


    Input the package name (com.unity.toolchain.macos-x86_64-linux-x86_64) and click Add.


    You should now see the toolchain in your list of packages in the project.


    More information about the Linux IL2CPP cross-compiler can be found in the Unity Manual, here: https://docs.unity3d.com/Manual/linux-IL2CPPcrosscompiler.html
     
  2. vakuor

    vakuor

    Joined:
    Jul 9, 2018
    Posts:
    17
    Still not working
    upload_2023-3-23_14-46-41.png
     
  3. branwenevans

    branwenevans

    Unity Technologies

    Joined:
    Mar 28, 2017
    Posts:
    7
    @vakuor sorry you're having problems - it seems likely that you might have found an issue with a specific version of Unity. Please open a support ticket and someone will help you resolve your problem; in the mean time feel free to share the link to your build log here and we can tell you if anything seems immediately obvious.
     
    AlgoritcomDev and vakuor like this.
  4. ken048

    ken048

    Joined:
    Apr 22, 2016
    Posts:
    3
    It happens when you use Apple Silicon version of Unity
    When using Intel there is no problem.
    Unity Technonlogies, please fix this!!!