首页 > 代码库 > cocos2d_x_01_环境搭建
cocos2d_x_01_环境搭建
Cocos2d-x-3.3 Mac 安装下载地址:
参考文档:
在线API列表:
Cocos2d-x-3.3 版本
从配置安装到创建项目都是命令行
- 官网下载最新版本Cocos2d-x-3.3,大小约为280M
- 解压后,在【终端】中
切换目录
到 解压后的目录,然后执行./setup.py
,回车,如下图所示.
- 解压后,在【终端】中
- 期间会有几次询问,是否要设置安卓SDK路径,
- 如果尚未安装Android开发环境,可以直接
Enter
跳过,暂不设置 - (将来 可以在下面的文件中,进行配置:/etc/profile)
1
2
3
|
|
根据提示,敲击命令:
source /Users/history/.bash_profile
然后
Enter
,这样就算设置好了.1
|
|
- 最后就是创建工程.
- 继续命令行
cd tools/cocos2d-console/bin
,- 接着使用下面命令即可:
cocos new 工程名 -p 包名 -l 语言 -d 目标文件夹
,- 例如 :
cocos newcocos2d_x -pcom.beyond -lcpp -d /Users/beyond/Desktop/project
- 执行后就有如下提示,表示OK~
1
2
3
4
5
6
|
|
打开自动创建好的项目
可以选择桌面应用,直接command+R,编译运行
等了n分钟过后,终于跑出来了~
后续补充一下:NDK目录的配置
进入终端,输入命令:sudo nano /etc/profile
打开配置环境变量的文件
根据实际情况,添加NDK_ROOT、ANT、SDK目录
最终,示例如下:
cocos2d_x_01_环境搭建
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。