XcodesOrg / xcodes

The best command-line tool to install and switch between multiple versions of Xcode.
MIT License
3.66k stars 122 forks source link

Allow non-superuser installation #177

Closed juanjonol closed 2 years ago

juanjonol commented 2 years ago

Hi! Thank you for making this super useful tool!

Currently xcodes requires superuser privileges to work. As far as I know, this is required to:

None of this seems like a hard requirement that should make xcodes fail (Xcode will do all this on its first run anyway), so I think adding a --no-superuser option to xcodes install would make sense.

Would you accept a pull request for this?

Thank you!

om-ha commented 1 year ago

@juanjonol @MattKiazyk

Enable developer mode, calling /usr/sbin/DevToolsSecurity -enable (I'm not sure what's this is for)

Correct me if I'm wrong, but apparently this is needed for hooking to another process when debugging within Xcode.

Otherwise you'd get the prompt shown in the StackOverflow answer, second link above.

However, this command should automatically be called as per the Xcode Developer Tools installer. This is referenced in the first link above:

When the Xcode developer tools are installed, the post-install script automatically runs this DevToolsSecurity tool to change the authorization policies

juanjonol commented 1 year ago

apparently this is needed for hooking to another process when debugging within Xcode.

Probably! But as you said, I guess this is automatically called most of the time. I've been using xcodes with the --no-superuser flag for months and I've never need to call /usr/sbin/DevToolsSecurity -enable manually.