简体   繁体   English

管理每个用户的Xcode命令行工具版本

[英]Manage Xcode Command Line Tools version for each user

I am using two different Xcode version with 2 different Command Line Tools version as well. 我正在使用两个不同的Xcode版本和2个不同的命令行工具版本。 On my Mac I have one user for development and the other one as a Jenkins slave and, for some reasons that don't belong here, I need to use different Command Line Tools version for each user. 在我的Mac上,我有一个用户进行开发,另一个用作Jenkins奴隶,由于某些原因不属于此,我需要为每个用户使用不同的命令行工具版本。 The thing is that every time I select a new Build Tools version, changes apply to all users. 问题在于,每次选择新的Build Tools版本时,更改都适用于所有用户。

Is there any way to select Build Tools version for EACH user? 有没有办法为EACH用户选择Build Tools版本?

The most direct way to solve yout problem would be using the environment var $DEVELOPER_DIR, as you can see here: 解决问题的最直接方法是使用环境var $ DEVELOPER_DIR,如下所示:

What is the difference between setting DEVELOPER_DIR and using xcode-select? 设置DEVELOPER_DIR和使用xcode-select有什么区别?

You can try to use this wrapper. 您可以尝试使用此包装器。 It allows you to execute xcode-select without sudo permissions: 它允许您在没有sudo权限的情况下执行xcode-select:

https://github.com/detroit-labs/safe-xcode-select https://github.com/detroit-labs/safe-xcode-select

Alternatively, if that doesn't work for you, you can try allowing xcode-select to be executed with sudo permissions but without the password: 或者,如果这对您不起作用,您可以尝试允许使用sudo权限执行xcode-select但不使用密码:

https://encyclopediaofdaniel.com/blog/sudo-without-a-password/ https://encyclopediaofdaniel.com/blog/sudo-without-a-password/

I hope it helps. 我希望它有所帮助。

Find your toolchain name (say swift-dev ) and then run: 找到你的工具链名称(比如swift-dev ),然后运行:

export TOOLCHAINS=swift-dev

on login? 在登录?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM