How to use sudo inside of a Run Script build phase in Xcode 4?

后端 未结 7 1895
梦谈多话
梦谈多话 2021-02-02 14:47

I need use execute a command inside of a script in a Run Script build phase in Xcode 4 using sudo. However, the compiler complains:

sudo: no tty present a

7条回答
  •  不知归路
    2021-02-02 15:03

    You can also execute XCode giving it the project as parameter from the Terminal using sudo like this:

    sudo /Developer/Applications/Xcode.app/Contents/MacOS/Xcode /path/to/your/project.xcodeproj
    

    This is the easiest solution I could think of, but there may be some drawbacks, since you would be executing XCode as root.

提交回复
热议问题