“Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.” when using GCC

后端 未结 11 1154
故里飘歌
故里飘歌 2020-11-30 16:54

While attempting to compile my C program, running the following command:

gcc pthread.c -o pthread

Returns:

Agreeing

相关标签:
11条回答
  • 2020-11-30 17:09

    If you have similar issues in Intellij do as others said above me :

    1. Open Terminal.
    2. Enter this command: sudo xcodebuild --license.
    3. Enter system password.
    4. Go to the end of file: Press space(button) to do that.
    5. Type 'Agree' to the license.

    And you are done.!!

    0 讨论(0)
  • 2020-11-30 17:11

    Open up Xcode, and accept the new user agreement. This was happening because a new version of Xcode was downloaded and the new agreement was not accepted.

    0 讨论(0)
  • 2020-11-30 17:11

    I had the same issue, after accepting the license launching XCode or running sudo xcodebuild -license accept i had to restart my Mac – otherwise it did not worked.

    0 讨论(0)
  • 2020-11-30 17:17

    I had the same issue when I tried to use git.

    It is possible to install git without it. And I doubt that gcc on mac is truly dependent on XCode. And I don't want to use root to accept something unless I'm sure I need it.

    I uninstalled XCode by navigating to the applications folder and dragging XCode to the trash.

    Now my git commands work as usual. I'll re-install XCode if/when I truly need it.

    0 讨论(0)
  • 2020-11-30 17:25

    Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

    A new version of OSX or XCode was installed and Apple wants you to agree to their Terms and Conditions. So just launch Xcode and "Agree" to them.

    0 讨论(0)
  • 2020-11-30 17:26
    sudo xcodebuild -license
    

    will take care of it with no trouble on the command line. Note that you'll have to manually scroll through the license, and agree to its terms at the end, unless you add "accept" to the command line :

    sudo xcodebuild -license accept
    
    0 讨论(0)
提交回复
热议问题