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

后端 未结 7 1918
梦谈多话
梦谈多话 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:54

    After much searching I found the following solution.

    https://forum.juce.com/t/build-script-for-automatically-moving-built-aus-into-components-folder-xcode/13112

    Summary

    1. Create a keychain and store your admin password in the keychain
    2. Create a script which uses /usr/bin/security to access the password In your run script,
    3. Set the ASK_PASS env variable and use the -A option with sudo

提交回复
热议问题