Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent the bloated official UnityHub from launching automatically? #28

Open
joethephish opened this issue Jan 26, 2023 · 7 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@joethephish
Copy link

I suspect this may be something that can't be controlled, but I find that what happens is:

  • I launch UnityHubNative on Mac and it's deliciously fast. I tell it to open my project.
  • My project launches correctly in Unity, hooray!
  • But then the official UnityHub opens automatically too 😫

I guess this is something on the Unity side, I don't suppose there is anything we can do to prevent it? (I guess I could just delete it! But I'd like to keep it around just in case...)

@Ravbug
Copy link
Owner

Ravbug commented Jan 26, 2023

I am not aware of any way to prevent the official hub from launching other than by deleting it. If you (or anyone else) learns of a way, please let me know.

@Ravbug Ravbug added enhancement New feature or request help wanted Extra attention is needed labels Jan 26, 2023
@runevision
Copy link

runevision commented Jan 28, 2023

I deleted the official hub which works nicely for launching projects without it opening, but unfortunately this seems to make it impossible to use the Asset Store. When I open the Asset Store and click on the My Assets button I get the dialog:

Install Unity Hub
You must install the Unity Hub to sign in and use Unity services. [Later] [Install]

It might be worth noting in the feature list on the readme page that "Manage Unity licenses" does not imply that one can sign in and use services such as the Asset Store.

@pioj
Copy link

pioj commented Jan 29, 2023

Well, Unity probably makes use of the Hub to fetch the user account's session, in order for the Editor to subscribe the packageManager/AssetStore tab later.

but, having the Unity Staff habits in mind, I suspect that data to be located in a file or a Registry key. It's only a matter of locating it and use it.

I don't think it would be a good idea to get ride of UnityHub completely, thus encouraging the Staff to eventually come with new ways to obfuscate this data into your computer. Just run HubNative as a complement is good enough.

@unitycoder
Copy link

i'm interested on this also, found out that if you create special IPC port (same name as hub uses),
then Editor wont launch hub (but you are then logged out too)..
unitycoder/UnityLauncherPro#95 (comment)

still chasing it, on how to reply for unity editor, from your dummy IPC port, with the correct authorization-code..

One workaround is also temporarily rename hub.exe, so its easier to enable it back when needed (no need to install/uninstall)

@dssste
Copy link

dssste commented Dec 9, 2024

i'm interested on this also, found out that if you create special IPC port (same name as hub uses), then Editor wont launch hub (but you are then logged out too).. unitycoder/UnityLauncherPro#95 (comment)

I use a small python script to start a dummy ipc server, and found this ipc trick useful enough. I switch between offline mode and signed in mode by either start the dummy ipc server or shut it down and let unity hub do it's thing, and because how infrequent I need the asset store, I very much enjoy the de-bloated offline experience.

So, in my opinion adding an option for offline vs allow hub is pretty nice.

@Ravbug
Copy link
Owner

Ravbug commented Dec 9, 2024

@dssste Would you be willing to share your Python script?

@dssste
Copy link

dssste commented Dec 9, 2024

@dssste Would you be willing to share your Python script?

import socket
import os

SOCKET_PATH = "/tmp/Unity-hubIPCService.sock"

if os.path.exists(SOCKET_PATH):
    os.remove(SOCKET_PATH)

server = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
server.bind(SOCKET_PATH)
server.listen(1)

print(f"Listening on {SOCKET_PATH}")

try:
    while True:
        conn, addr = server.accept()
        print("Connection received")
        data = conn.recv(1024)
        print("Received:", data.decode("utf-8"))
        conn.close()
except KeyboardInterrupt:
    print("\nShutting down...")
finally:
    server.close()
    os.remove(SOCKET_PATH)

It was from chatGPT, and I didn't look into the details as it seems to work just fine (plus I don't know sockets well enough).

Also the shell function I use:

function unity() {
	nohup bash -c "
	python3 ~/path/to/main.py &
	DUMMY_SERVER_PID=\$!

	/Applications/Unity/Hub/Editor/6000.0.27f1/Unity.app/Contents/MacOS/Unity -projectPath \"$1\" &
	UNITY_PID=\$!

	wait \$UNITY_PID
	kill \$DUMMY_SERVER_PID
	" > ~/path/to/main.log 2>&1 &
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants