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

后端 未结 7 1899
梦谈多话
梦谈多话 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 14:52

    No need to write your sudo password anywhere. Just open a terminal window and type

    $ sudo echo "hello"
    

    Once you've typed your password, it will be good for a while - not sure how long - and the shell spawned by Xcode will inherit this permission.

    If you get the "no tty present" message again later, just repeat the procedure

提交回复
热议问题