Avoid loading AR subsystems at the initialization of the app.

Hello,

I am encountering a problem with the initialization of the app in iOS. When the app starts it gets grey screen for 0.5-1s until it shows the first scene.

I’ve tracked Xcode debugging and found this:

->
-> applicationDidFinishLaunching()

[Physics::Module] Initialized MultithreadedJobDispatcher with 5 workers.

[Subsystems] Discovering subsystems at path /private/var/containers/Bundle/Application/BC834353-0817-4A89-83EB-9584DB7FFA0F/CyLAR.app/Data/UnitySubsystems

[Subsystems] No descriptors matched for  examples in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.

[Subsystems] 1 'inputs' descriptors matched in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json

[Subsystems] No descriptors matched for  displays in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.

[Subsystems] No descriptors matched for  meshings in UnitySubsystems/UnityARKit/UnitySubsystemsManifest.json.

[Subsystems] No descriptors matched for  examples in UnitySubsystems/UnityMagicLeap/UnitySubsystemsManifest.json.

[Subsystems] 1 'inputs' descriptors matched in UnitySubsystems/UnityMagicLeap/UnitySubsystemsManifest.json

[Subsystems] 1 'displays' descriptors matched in UnitySubsystems/UnityMagicLeap/UnitySubsystemsManifest.json

[Subsystems] 1 'meshings' descriptors matched in UnitySubsystems/UnityMagicLeap/UnitySubsystemsManifest.json

GfxDevice: creating device client; kGfxThreadingModeThreaded

Initializing Metal device caps: Apple A13 GPU

Initialize engine version: 2023.2.1f1 (a6dd9a634651)

XRGeneral Settings awakening...

UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)

UnityEngine.XR.Management.XRGeneralSettings:Awake()

New input system (experimental) initialized

UnloadTime: 1.733250 ms

I have tried to Initialise Subsystems few seconds after the loading of the APP, but the time still be 1.7ms. I have tested an empty project and the UnloadTime is around 0.2ms (almost instant).

Thanks in advice!
Diego

Hi diegosobrinoutad,

Unfortunately, a debug iOS build built and executed from within XCode takes that long to launch due to beginning application launch, loading, and caching on first run. Subsequent executions should be much faster.

Hi @mike-copley-unity ,

The delay in loading Unity first scene is also ocurring when device is not plugged into XCODE debugguer.

Any suggestion how could I speed up the loading process?

This may not be related to your issue but you shouldn’t be seeing Magic Leap subsystems trying to initialize on ARKit. Something is wrong there.

@andyb-unity I’ve deleted Magic Leap package, but has no impact.

I have tried building AR Foundations Samples and XCODE debugged this:

-> applicationDidBecomeActive()
UnloadTime: 1.547375 ms

Edit: I guess Unload time is not representative because the app is opened instantly.