Reloading Unity as a Library in Same Session

Is there further documentation or clarification about the actual technical limitation(s)/reason(s) that prevents Unity as a Library from being able to be completely shut down and reloaded inside the same parent app session on iOS? This limitation has significant bearing on multiple applications that I work with and would be great to investigate further on our end if there is a way that we can possibly work around it.

Thank you in advance for your help.

Thanks for reaching out. Have you checked the iOS limitations for the issue you mentioned in the following pages:

Your message has been received. Thank you for reaching out. The issue you mentioned in the following pages may be limited by iOS limitations. I suggest you check those restrictions:

Thank you for your reply. To answer your question, we have previously reviewed both of those documents, but they do not answer the question. The only documentation that provides some form of hints into the reasoning is actually from Apple; but that really just talks about why one shouldn’t use exit. None of the documents clarify why Unity as a Library (iOS) cannot be reloaded inside the same session when using Application.Quit. The method that the app uses to exit is relatively irrelevant to us as long as it completely shuts down and can be reloaded in the same user session; the same as Android can. Without knowing the why we have no way of investigating our own alternate workaround.

Thanks again for your help.

Hi, this is the limitation of the Unity Engine. There are many core systems which can’t be re-initialized. When you try to relaunch Unity app in the same app session, dlopen just maps the same memory location as was used during the previous run. The dirty state causes initialization to fail.

Thank you for following up with this question. We were hoping for a little more of the “why” the core systems can’t be reinitialized, but we understand the issue with dlopen creating the dirty state. Thanks again.