更新cocos2d的问题

时间:2012-04-02 19:31:13

标签: cocos2d-iphone installation

我在将Cocos2d更新到当前版本时遇到问题。我删除了旧模板文件并使用命令

安装了新版本
./install-templates.sh -u -f 

但我总是在终端中获得以下内容:

Installing Xcode 4 Box2d iOS template
-------------------------------------------------

mkdir: /Users/jubilate/Library/Developer/Xcode/Templates/cocos2d v2.x: Permission denied
...copying Box2d files
rsync: mkdir "/Users/jubilate/Library/Developer/Xcode/Templates/cocos2d v2.x/lib_box2d.xctemplate/libs" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at /SourceCache/rsync/rsync-42/rsync/main.c(544) [receiver=2.6.9]
rsync: connection unexpectedly closed (8 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-42/rsync/io.c(452) [sender=2.6.9]
rsync: mkdir "/Users/jubilate/Library/Developer/Xcode/Templates/cocos2d v2.x/lib_box2d.xctemplate/libs" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at /SourceCache/rsync/rsync-42/rsync/main.c(544) [receiver=2.6.9]
rsync: connection unexpectedly closed (8 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-42/rsync/io.c(452) [sender=2.6.9]
done!

Installing Xcode 4 CCNode file templates...
----------------------------------------------------

...creating destination directory: /Users/jubilate/Library/Developer/Xcode/Templates/File   Templates/cocos2d v2.x/
mkdir: /Users/jubilate/Library/Developer/Xcode/Templates/File Templates/cocos2d v2.x: Permission denied
mv: rename /Users/jubilate/Library/Developer/Xcode/Templates/cocos2d v2.x//CCNode   class.xctemplate to /Users/jubilate/Library/Developer/Xcode/Templates/File Templates/cocos2d v2.x/:   No such file or directory
done!

有人可以帮助我吗?在此先感谢

2 个答案:

答案 0 :(得分:3)

我也有同样的问题。事实证明,由于我之前的cocos2d(v1)被安装为“root”。

如果你做了

ls -ltr /Users/jubilate/Library/Developer/Xcode/

你会看到“模板”的权限是“root staff”

你需要“sudo -s”,输入你的root用户密码,然后

cd "/Users/jubilate/Library/Developer/Xcode/"
chown jubilate:staff Templates

这会将“模板”的权限更改为“jubilate staff”,然后您可以进行安装。

试一试,看看它是怎么回事。

干杯

答案 1 :(得分:0)

您可能使用sudo命令安装了以前的模板。您必须手动删除Finder中的文件。

删除以“cocos2d”开头的这些文件夹:

~/Library/Developer/Xcode/Templates/cocos2d*
~/Library/Developer/Xcode/Templates/File Templates/cocos2d*