如何设置cocos2x控制台工具路径? [英] How to setup cocos2x console tool path?

查看:170
本文介绍了如何设置cocos2x控制台工具路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将cocos2d-x设置为此处的概述: http://www.codeproject.com/Articles/801093/Writing-Games-with-Cplusplus-for-Android-on-a-Mac

I setup cocos2d-x as outlines here: http://www.codeproject.com/Articles/801093/Writing-Games-with-Cplusplus-for-Android-on-a-Mac

Setup.py具有所有预期的输出,

Setup.py had all the expected output,

./setup.py

./setup.py

设置cocos2d-x ... ->检查环境变量COCOS_CONSOLE_ROOT->搜索环境变量COCOS_CONSOLE_ROOT ... ->找到COCOS_CONSOLE_ROOT:/Users/john/Documents/Projects/Cocos2d/cocos2d-x-3.5/tools/cocos2d-console/bin

Setting up cocos2d-x... ->Check environment variable COCOS_CONSOLE_ROOT ->Search for environment variable COCOS_CONSOLE_ROOT... ->COCOS_CONSOLE_ROOT is found : /Users/john/Documents/Projects/Cocos2d/cocos2d-x-3.5/tools/cocos2d-console/bin

->检查环境变量COCOS_TEMPLATES_ROOT->搜索环境变量COCOS_TEMPLATES_ROOT ... ->找到COCOS_TEMPLATES_ROOT:/Users/john/Documents/Projects/Cocos2d/cocos2d-x-3.5/templates

->Check environment variable COCOS_TEMPLATES_ROOT ->Search for environment variable COCOS_TEMPLATES_ROOT... ->COCOS_TEMPLATES_ROOT is found : /Users/john/Documents/Projects/Cocos2d/cocos2d-x-3.5/templates

->仅适用于Android平台的配置,您还可以跳过并手动编辑"/Users/john/.bash_profile"

->Configuration for Android platform only, you can also skip and manually edit "/Users/john/.bash_profile"

->检查环境变量NDK_ROOT->搜索环境变量NDK_ROOT ... ->找到NDK_ROOT:/Users/john/Documents/Projects/Android/android-ndk-r9d

->Check environment variable NDK_ROOT ->Search for environment variable NDK_ROOT... ->NDK_ROOT is found : /Users/john/Documents/Projects/Android/android-ndk-r9d

->检查环境变量ANDROID_SDK_ROOT->搜索环境变量ANDROID_SDK_ROOT ... ->找到ANDROID_SDK_ROOT:/Users/john/Documents/Projects/Android/adt-bundle-mac-x86_64-20140321/sdk

->Check environment variable ANDROID_SDK_ROOT ->Search for environment variable ANDROID_SDK_ROOT... ->ANDROID_SDK_ROOT is found : /Users/john/Documents/Projects/Android/adt-bundle-mac-x86_64-20140321/sdk

->检查环境变量ANT_ROOT->搜索环境变量ANT_ROOT ... ->找到ANT_ROOT:/Users/john/Documents/Projects/ANT/apache-ant-1.9.4/bin

->Check environment variable ANT_ROOT ->Search for environment variable ANT_ROOT... ->ANT_ROOT is found : /Users/john/Documents/Projects/ANT/apache-ant-1.9.4/bin

请执行命令:源/Users/john/.bash_profile"以使 添加的系统变量生效

Please execute command: "source /Users/john/.bash_profile" to make added system variables take effect

但是我不能直接运行cocos:

but I cannot run cocos directly:

例如:cocos

我总是必须输入完整路径: 例如:

I always have to type the full path: Eg:

/Users/john/Documents/Projects/Cocos2d/cocos2d-x-3.5/tools/cocos2d-console/bin/cocos

结果,我无法运行./build_native.py等来生成我的android构建,因为它错误地指出:sh: cocos: command not found

As a result, I cannot run ./build_native.py etc for generating my android build because it errors out saying : sh: cocos: command not found

我运行了"source /Users/john/.bash_profile"命令,setup.py表示我应该这样做,但这没什么区别.

I ran the "source /Users/john/.bash_profile" command that setup.py said I should but it makes no difference.

我该如何纠正?

(Cocos2dx 3.5)

(Cocos2dx 3.5)

当我在终端中键入:"export"时,找不到用于设置环境变量的任何行:

When I type: "export" in the terminal, I cannot find any lines for setting the environment variables for:

NDK_ROOT
COCOS_CONSOLE_ROOT

我该如何纠正?

推荐答案

我将cocos控制台根目录手动添加到bash_profile中.

I added cocos console root to the bash_profile manually.

这是我的工作方式:

在终端中,键入:

open ~/.bash_profile

它将在TextEdit中打开. 添加这些行:

It will be opened within TextEdit. Add these lines :

export COCOS_CONSOLE_ROOT=/Users/barisatamer/Documents/workspace-game/Engine_Source/cocos2d-x-3.4/tools/cocos2d-console/bin
export PATH=$COCOS_CONSOLE_ROOT:$PATH

这篇关于如何设置cocos2x控制台工具路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆