Unity project is already opened. When is not.

Device: Macbook pro m2 chip apple.
Unity Hub version: 3.5.1
Unity editor version: 2021.3.13

How to reproduce:
When I get a “Unity not responding” I can’t close the app with the X buttton. So I open the “Force quit application” of Apple (is like the task manager of Windows) I select the Unity editor and force quit. Then I try to open the Unity project again but it says that is already opened. The only way to fix this is restart the computer.

Here is a full video:

same problem here :rage:

Same here. Killing the process doesn’t actually kill the lock file, which I needed to do manually.

Unity v2022.3.14f1

The location of the lockfile that needs to be removed:

Temp/UnityLockfile

Still cant delete the UnityLockFile if it is still “running” in Unity Editor, which it isn’t.

I found a solution for the lock file not being able to be deleted you need first to remove the project from list via unity hub, then restart your pc and then you should be able to delete it.

sounds like either a process is still running or something like antivirus hasnt let go of the file yet. Have you done some process debugging to see if thats the case?

Is there anything Unity related showing in activity monitor?

This is an old thread but still the first result in google for this issue.

If your “UnityLockFile” cannot be deleted because something is using it, you can try this.

  • Open Task Manager (Ctrl+Shift+Escape)
  • Go to the Performance Tab
  • Click on “Open Resource Monitor” at the bottom
  • In the CPU tab, in the “Associated Handles” section, use the search bar at the top right and search for “UnityLockFile” or just “Unity”.
  • Right click the entry that points to “UnityLockFile”, and end process

That should end the process that is preventing it from being deleted. Then you can delete it and try launching your project again.

You can solve this issue removing the folder /temp from the unity root project.