Version: 2019.1
iOS 2D Texture Overrides
Unity Remote

Upgrading to 64-bit iOS

iOS 64-bit support is implemented with the scripting backend called IL2CPP. It runs with your C# code.

El IL2CPP runtime combina un compilador ahead of time (AOT) con una maquina virtual para convertir assemblies a C++ mientras aprovecha los compiladores estándar C++ de plataforma para producir binarios nativos. El resultado neto es un rendimiento significativamente mayor, la compatibilidad de la plataforma y la facilidad de mantenimiento.

IL2CPP is the only scripting backend to support deploying to ARM 64-bit on iOS, and is thus mandatory to deploy to the Apple App Sstore for releasing new apps.

To read more about IL2CPP, see the blog posts The future of scripting in Unity and Apple iOS 64-bit support in Unity.

Cómo empezar a utilizar IL2CPP en iOS

Select IL2CPP in the Scripting Backend drop-down menu on the Player window.

Selección del scripting backend
Selección del scripting backend

By default it will build for Universal architecture (including both ARM64 and ARMv7); if needed you can switch to specific architecture on the Player window. There are a number of things that should be done before your application is up and running in 64-bits:

  • You need a 64-bit capable device to test on: all iOS devices with A7 or later chip (currently these are: iPhone 5S, iPad Air, iPad Mini Retina, iPhone 6, iPhone 6 Plus, iPad Mini 3, and all newer devices).
  • You need all your native plugins to be compiled with 64-bit support (or be provided as source code). If you are using a 3rd party plugin, you should contact your plugin vendor to obtain a 64-bit capable and IL2CPP-compatible version of that plugin. At the moment all latest Prime31 plugins should work.
  • Si es un proveedor de plugins o simplemente tiene sus propios plugins nativos entonces necesita mantener un par de cosas en mente:
    • IL2CPP is not API-compatible (which is unexposed) with the Mono Runtime API, which means if plugin is using mono_* functions won’t link anymore. The best way to resolve this issue is to switch to a managed delegate/callback approach and pass your managed callbacks to the native side of plugin, and call them back from there when some native data or event arrives.
    • Todos los plugins que vienen como librerías estáticas pre-compiladas (archivos .a) ahora deberían incluir ARM64 slice.
    • When doing native code/type conversion keep in mind that pointers and longs are now 64-bit wide and ints are still 32-bit wide.
  • To minimise generated amount of C++ code IL2CPP is always (even when Stripping level is set to Disabled) doing some sort of managed code stripping. Sometimes you will need to help it. Look for the link.xml guide in the iOS player size optimization manual.

Resolución de problemas

  • Q: My code is running slower on IL2CPP than on Mono. Why?
    A: Make sure you are testing your code performance in Xcode Release configuration. If issue still remains, please submit a bug report!
  • Q: Unity generated Xcode project fails to compile with following or similar error: Method not found: 'Default constructor not found...ctor() of System.ComponentModel.Int64Converter'.
    A: Deserializers and serializers often reference some types only via .NET Reflection API and in such cases these methods or even classes might be stripped from the project. You can hint managed code stripper that specific class / method is used either via link.xml or via introduction of dummy code that explicitly references it in one of your scripts.
  • Q: Unity generated Xcode project fails to compile with some other error.
    A: Please verify that all your plugins support ARM64 and IL2CPP and if so, please submit a bug report and attach your project (or just the scripting part of it) to the bug report.

iOS 2D Texture Overrides
Unity Remote
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961