xcode-select -switch doesn't work: active developer path does not exist

前端 未结 6 1552
灰色年华
灰色年华 2021-02-20 13:22

I have installed Xcode 5 developer preview 3. Before it i had developer preview 2 and now, sometimes in my terminal I see error, for example when I try to autocomplete some comm

相关标签:
6条回答
  • 2021-02-20 14:03

    It happened to me once: xcode-select -print-path did stick to the same value and wasn't changing. It appeared that it was always equal to DEVELOPER_DIR environment variable. According to the manpage of xcode-select:

    When DEVELOPER_DIR is set, its value will be used instead of the value last passed to -switch xcode_path

    So, unsetting DEVELOPER_DIR makes xcode-select -switch working.

    0 讨论(0)
  • 2021-02-20 14:09

    If you do a:

    man xcode-select
    

    It tells you to set the path with:

    xcode-select -s /Applications/Xcode-DP4.app
    

    As I've just switched to DP4 to test. That worked for me. I didn't see it point to any of the .app contents. I guess this was probably changed from previous versions...

    0 讨论(0)
  • 2021-02-20 14:18

    Try changing the path in xcode itself. enter image description here

    0 讨论(0)
  • 2021-02-20 14:23

    I've got this error after I change the name of Xcode app. I changed Xcode app to Xcode8.1.app. Then I run command

    sudo xcode-select -switch /Applications/Xcode8.1.app/Contents/Developer
    

    and now everything work as beginning.

    Not sure are you in my case and your problem is solved or not. Maybe help another one.

    0 讨论(0)
  • 2021-02-20 14:24

    Sometimes, space characters don't allow to take path correctly. So you may prefer to use \ character to include space into the path like below;

    $ sudo xcode-select --switch /Applications/Xcode\ 10.2.app/Contents/Developer
    
    0 讨论(0)
  • 2021-02-20 14:25

    If you are running beta release. Path should be look like this.

    sudo xcode-select -switch /Applications/Xcode-beta.app/Contents/Developer
    
    0 讨论(0)
提交回复
热议问题