If the same problem still exists, then the following code is deleted in the script and puts all things in the next path and deletes the next code in the script.
The way to put all things
Macintosh HD => Developer => Library => Xcode => Templates
Remove this code in the script
# Make sure root is not executed if [[ "$(id -u)" != "0" ]]; then echo "" echo "Error: Do not run this script as root." 1>&2 echo "" echo "'root' is no longer supported" 1>&2 echo "" echo "RECOMMENDED WAY:" 1>&2 echo " $0 -f" 1>&2 echo "" exit 1
Then save the install-templates.sh file
and then follow these steps.
1) Open the Terminal Window application → Utilities-> Terminal
2) Enter cd, drag and unzip the cocos2D open source file.
3) Type sudo to drag the file 'install-templates.sh' from the downloaded file.
3) Enter your password
4) Restart Xcode, then you are working with Cocos 2D
This is ridiculous, but solve my problem.
source share