![image](https://private-user-images.githubusercontent.com/17833862/281181731-f07c7396-b0da-4ce4-bfef-e9103de8c976.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0NDAxNDksIm5iZiI6MTcyMDQzOTg0OSwicGF0aCI6Ii8xNzgzMzg2Mi8yODExODE3MzEtZjA3YzczOTYtYjBkYS00Y2U0LWJmZWYtZTkxMDNkZThjOTc2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA4VDExNTcyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZmMWUzMzFhMDY4ODg5NmQwYjQ1YjNiYzhiNmQ3ODUzNGViYmI5ZTRmNDVhODRhNzViNmRlYjM3MGQ1Y2U1NWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.lH_bQPXIi8FfxyikMMgZseDJ4YWE0y4MdTUc3G_UCCU)
A lightweight command-line script designed to speedup opening Unity projects. With a single command, this script launches a Unity project directly from within the project's directory tree, bypassing the Unity Hub for enhanced speed and convenience. It's tailored for developers who prefer the efficiency of a terminal-based approach.
Recommended workflow:
- Open your Unity project in your IDE from the recent projects list
- Use a keyboard shortcut to open the command line window in the open Unity project working directory
- Use the launcher command to open the Unity project
This approach is much quicker than:
- Waiting for the slow Unity Hub to start
- Selecting the Unity project in the list and waiting for it to open
- Double-clicking a script or selecting Assets > Open C# Project in Unity to open the IDE
The script currently only supports macOS and was tested on Ventura 13.4.
- Install Python 3
- Place the launcher script anywhere on your machine
- Create a globally available command alias that points to the script. For example, for the ZSH shell, add
alias unity="~/bin/open-unity.py"
to the.zshrc
file.
echo 'alias unity="~/bin/open-unity.py"' >> ~/.zshrc
Alternatively, rename the script to unity and place it in a directory that is part of the PATH shell variable.
Open your IDE (e.g. Rider or Visual Studio) with the desired Unity project or any command line session in one of the following directories:
- The Unity project root directory (which contains Assets, Library and ProjectSettings)
- Any direct child directory (e.g. Assets, Library, ProjectSettings)
- A directory which contains the directory "frontend" which is the Unity project root
Invoke the unity
command alias to start Unity and open the current project:
unity
Pass additional arguments via the command:
unity -force-metal
Find the available Unity editor command line arguments in the official documentation.
The script is intended to be used in source form so that it can be easily customized, e.g. update the directories that are searched for the Unity project or change the command line arguments passed to Unity by default.