之前一直用cocos2d-x 2.0.4版本 ,因项目要求,更换cocos2d-x 2.1.4版本。那么具体操作如下:
1.卸载cocos2d-x:(将隐藏的模板文件删除掉)
1)打开你mac终端,输入命令:
显示Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles YES
隐藏Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles NO
输入回车,关闭终端。
2)点击你mac桌面菜单的“小苹果”图标,选择“强制退出”菜单,然后选择“Finder”,然后选择“重新启动”。现在所有隐藏文件可以看到了,删除Xcode中的Cocos2d/Cocos2dX模版:
/Users/xxx(用户名)/Library/Developer/Xcode/Templates/cocos2d-x 文件夹
2.安装cocos2d-x:
打开终端,进入cocos2d-x目录
执行命令: sudo ./install-templates-xcode.sh
mac需要你输入相关的密码,输入正确的密码,然后就看到下面类似的输出
localhost:cocos2d-2.0-rc2-x-2.0.1 user$ sudo ./install-templates-xcode.sh
Password:
cocos2d-x template installer
Installing Xcode 4 cocos2d-x iOS template
----------------------------------------------------
...creating destination directory: /Users/user/Library/Developer/Xcode/Templates/cocos2d-x/
...copying cocos2d files
...copying CocosDenshion files
...copying template files
done!
Installing Xcode 4 Chipmunk iOS template
----------------------------------------------------
...copying Chipmunk files
done!
Installing Xcode 4 Box2d iOS template
----------------------------------------------------
...copying Box2D files
done!
Installing Xcode 4 lua iOS template
----------------------------------------------------
...copying lua files
done!
done!
打开xcode,创建新项目,就看了xcode项目模板了。
接下来,就开始cocos2d-x 2.1.4 学习吧。。。