下载了cocos2d 2.0beta,在安装时碰到了两个错误:
1.习惯性的使用sudo ./install-templates.sh –f
结果提示从2.0beta开始,不允许再使用 root 安装
2.进入相关目录,使用标准化的./install-templates.sh –u –f安装,杯具来了:
Installing Xcode 4 cocos2d iOS template ----------------------------------------------------
removing old libraries: /Users/eseedo/Library/Developer/Xcode/Templates/cocos2d/
rm: /Users/eseedo/Library/Developer/Xcode/Templates/cocos2d//base.xctemplate/TemplateInfo.plist: Permission denied
rm: /Users/eseedo/Library/Developer/Xcode/Templates/cocos2d//base.xctemplate: Permission denied
rm:/Users/eseedo/Library/Developer/Xcode/Templates/cocos2d//base_ios.xctemplate/Resources/Default.png: Permission denied
……
然后下面还有一堆新的Permission denied
弄了半天终于找到方法了,未还在烦恼的朋友分享一下。
sudo vi install-templates.sh
打开install-templates.sh找到
# 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
fi
删除这段,保存退出。
然后sudo ./install-templates.sh 成功!!!